Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux ssh:不允许用户的shell不存在 阿帕奇 CentosOS 5 普莱斯克10_Linux_Git_Shell_Ssh - Fatal编程技术网

Linux ssh:不允许用户的shell不存在 阿帕奇 CentosOS 5 普莱斯克10

Linux ssh:不允许用户的shell不存在 阿帕奇 CentosOS 5 普莱斯克10,linux,git,shell,ssh,Linux,Git,Shell,Ssh,新的命令行和ssh 在试图让多个用户(root git-friend)通过ssh连接到同一个shell并配置无密码连接时,我肯定犯了一个错误 我可以不再以root或git身份通过ssh登录,但可以作为朋友登录,我通过编辑etc/passwd传输了他的shell。 幸运的是,我仍然可以登录plesk,这样就可以编辑gui文件了 这是我在sshd错误日志中发现的 sshd[11999]: User git not allowed because shell /bin/bash\r does not

新的命令行和ssh

在试图让多个用户(root git-friend)通过ssh连接到同一个shell并配置无密码连接时,我肯定犯了一个错误

我可以不再以root或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\n 但在哪里恢复呢? 下面是一些配置

etc/ssh/sshd\u配置:

PubkeyAuthentication yes
ect/外壳

/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/false
/usr/local/psa/bin/chrootsh
/bin/rbash
etc/passwd

git:x:10009:10009::/home/git:/bin/bash
friend:x:10010:10010::/home/git:/bin/bash
早些时候,我尝试安装无密码连接 因此,在服务器和本地机器上的某处有一个.ssh/id_rsa文件

读后

我试过了

ssh-add -l
Could not open a connection to your authentication agent
我的问题是这样的:

如果我以好友身份通过ssh登录,则无法sudo到root:

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
希望有人能帮我澄清一下

如果需要,很乐意提供更多信息

/bin/bash\r
表示您已使用Windows编辑器编辑了/etc/passwd或/etc/shell,因为它包含Windows换行符
\r\n
。Linux只解释
\n
,并假定剩余的
\r
是二进制名称的一部分

解决方案:在Linux编辑器中打开文件,删除新行并再次添加

您还可以安装软件包
tofrodos
并执行:

fromdos /etc/passwd
fromdos /etc/shells

正确,我是在Plesk中做的,现在我尝试快速学习vi,首先将权限更改为friendvim是编辑文件的最佳选择(IMO:)如果您需要更简单的开始,您可以使用
nano
甚至
mc
奇怪,我尝试删除换行符,但没有wq但仍然是相同的错误:/bin/bash\rHmmm:wq不适合保存:x是我在手册中读到的。现在使用vim。但还是一样的错误。即使在每个bin/bash行上退格并再次输入后。您是否尝试过DOS中的