新的命令行和ssh。
在尝试让多个用户(根git朋友)将ssh放到同一个shell并配置无密码连接时,我一定犯了一个错误。
我可以不再以根或git的身份在ssh上登录,而是可以作为我通过编辑etc/passwd传输的shell的朋友。幸运的是,我仍然可以登录plesk,所以gui文件编辑是可能的。
这是我在我的sshd错误日志中发现的
sshd[11999]: User git not allowed because shell /bin/bash\r does not exist
sshd[12000]: input_userauth_request: invalid user git
sshd[11999]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.xxx.xxx.dynamic.upc.nl user=git
sshd[11999]: Failed password for invalid user git from xxx.xxx.xxx port 54851 ssh2我读到了一些有关sudo ing和偶然输入的内容:导致\r,但是在哪里恢复呢?以下是一些配置
etc/ssh/sshd_config:
PubkeyAuthentication yesect/外壳
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/false
/usr/local/psa/bin/chrootsh
/bin/rbashetc/护照d
git:x:10009:10009::/home/git:/bin/bash
friend:x:10010:10010::/home/git:/bin/bash早些时候,我尝试安装密码减少连接,以便在服务器和本地计算机上的某个地方有一个. .ssh/id_rsa文件。
读完Git's famous "ERROR: Permission to .git denied to user"后
我试过了
ssh-add -l
Could not open a connection to your authentication agent我的问题类似于这样:https://serverfault.com/questions/480806/ssh-root-access-denied-after-changing-shell
如果我以朋友的身份登录ssh,我不能这样做:
sudo root
friend is not in the sudoers file我也不能喋喋不休
[friend@vpsXXX ~]$ chsh -s /bin/bash root
chsh: Running UID doesn't match UID of user we're altering, shell change denied希望有人能帮我澄清这件事。
如有需要,乐意提供更多信息。
发布于 2013-09-19 14:05:29
/bin/bash\r意味着您已经用Windows编辑了/etc/passwd或/etc/shell,因为它包含Windows提要\r\n。Linux只解释\n,并假定剩余的\r是二进制名称的一部分。
解决方案:在Linux编辑器中打开文件,删除新行并再次添加。
此外,您还可以安装包tofrodos并执行:
fromdos /etc/passwd
fromdos /etc/shellshttps://stackoverflow.com/questions/18896825
复制相似问题