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@example.com reply 0 Last login: Tue Mar 12 09:21:23 2019 from 184.108.40.206 debug1: channel 0: free: client-session, nchannels 1 Connection to 220.127.116.11 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 18.104.22.168 port 40872 ssh2 pam_unix(sshd:session): session opened for user jenkins by (uid=0) Received disconnect from 22.214.171.124 port 40872:11: disconnected by user Disconnected from 126.96.36.199 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!