I created a user for jenkins on my remote server that worked previously just fine, but now when I try to login with shh on the server the connection closes immediately after login. This is strange because on the website that is hosting jenkins it seem to work just fine, I can log there with chrome no problem and it evan builds succefully. My only problem is when I SSH with that user jenkins on the server. Will add here the ssh -v logs when I get disconnected:

debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
Last login: Tue Mar 12 09:21:23 2019 from
debug1: channel 0: free: client-session, nchannels 1
Connection to closed.
Transferred: sent 2652, received 3604 bytes, in 0.5 seconds
Bytes per second: sent 5268.4, received 7159.7
debug1: Exit status -1

This is what I get after I insert the password.

I will also post the sshd logs:

Accepted password for jenkins from port 40872 ssh2
pam_unix(sshd:session): session opened for user jenkins by (uid=0)
Received disconnect from port 40872:11: disconnected by user
Disconnected from port 40872
pam_unix(sshd:session): session closed for user jenkins

I have this setup in the passwd:


I have to add that I can ssh with other users on the server just fine. I also tryed to su jenkins from root: This will just freeze my terminal and will open something like this:

jenkins@vps531680:/root$ root@vps531680:~# root@vps531680:~# logout

and I will get disconnected.

I also tryed this sudo usermod -s /bin/bash jenkins:

bash: /root/.bashrc: Permission denied
jenkins@vps531680:~$ Killed

On the weird side is that if I just reboot the server, for like 5-10 mins after that my jenkins user works just fine, but I will get disconnected after that time and I won't be able to SSH again, only after another reboot and for 5-10 mins. Any advice will be apreciated!

1 Answer 1


Check to see if the home directory for Jenkins was created?


  • No, there isn't any dir for that user, but on other VPS I don't have it either and works fine, in any case I created a dir jenkins in home, still the same issue. Commented Mar 14, 2019 at 8:51
  • 1
    Was asking because I had this same issue and creating the directory solved it.
    – VinDev
    Commented Mar 14, 2019 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.