我在我的远程服务器上为jenkins创建了一个用户,它以前工作得很好,但是现在当我尝试在服务器上使用shh登录时,连接在登录后立即关闭。这很奇怪,因为在托管jenkins的网站上,它似乎工作得很好,我可以用chrome无问题登录,evan成功地构建了它。我唯一的问题是当我在服务器上与那个用户jenkins进行SSH时。当我断开连接时,将在这里添加ssh -v日志:
debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
Last login: Tue Mar 12 09:21:23 2019 from 82.78.220.8
debug1: channel 0: free: client-session, nchannels 1
Connection to 145.239.84.136 closed.
Transferred: sent 2652, received 3604 bytes, in 0.5 seconds
Bytes per second: sent 5268.4, received 7159.7
debug1: Exit status -1这就是我插入密码后得到的信息。
我还将张贴sshd日志:
Accepted password for jenkins from 82.78.220.8 port 40872 ssh2
pam_unix(sshd:session): session opened for user jenkins by (uid=0)
Received disconnect from 82.78.220.8 port 40872:11: disconnected by user
Disconnected from 82.78.220.8 port 40872
pam_unix(sshd:session): session closed for user jenkins我在密码中有这样的设置:
jenkins:x:113:118:Jenkins,,,:/var/lib/jenkins:/bin/bash我必须补充一点,我可以和服务器上的其他用户一起使用ssh。我还从root中尝试了su jenkins:这只会冻结我的终端并打开如下所示的内容:
jenkins@vps531680:/root$ root@vps531680:~# root@vps531680:~# logout我会被切断连接的。
我还尝试了这个sudo usermod -s /bin/:
bash: /root/.bashrc: Permission denied
jenkins@vps531680:~$ Killed奇怪的是,如果我只是重新启动服务器,在5-10分钟之后,我的jenkins用户工作得很好,但在那之后我会被断开连接,我将不能再次SSH,只有在另一次重新启动和5-10分钟之后。任何建议都会被采纳!
发布于 2019-03-13 22:44:36
检查是否创建了Jenkins的主目录?
/home/jenkins
https://devops.stackexchange.com/questions/6588
复制相似问题