Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to use the transfer tool in WHM. There was some connection issues. So I tried to SSH into the server to see if it would work. Each time I use Putty it closes immediately after I enter my password. Is there anything I can check on the server to allow me to connect?
I tried using the terminal in WHM and looked at the logs
# tail -f -n 50 /var/log/secure | grep sshd
pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.xxx.xx.xx user=myname
error: PAM: Authentication failure for myname from xxx.xxx.xx.xx
Accepted keyboard-interactive/pam for myname from xxx.xxx.xx.xx port 58783 ssh2
pam_unix(sshd:session): session opened for user myname by (uid=0)
pam_unix(sshd:session): session closed for user myname
Web Host Manager, or WHM, is the program that allows administrative access to the back end of cPanel. Unfortunately they don't offer detailed support. Usually when things come up, I have to figure it out and learn. Yes the password has been changed. I have also posted on the cpanel forum but no replies yet.
One thing I noticed was this line in the config file. It doesn't say yes or no because its commented out.
vi /etc/ssh/sshd_config
# Authentication:
#PermitRootLogin yes
My new server that I can log in reads like this:
PermitRootLogin no
I wasn't sure if that could be the issue. "myname" is the root root/admin/main user of the server. If I purposely enter the wrong password it will say access denied. If I enter it correct the connection is terminated. Maybe I need to fix something in the pam settings?
Commented out entries in sshd_config typically reflect the defaults.
root is the only “root/main/admin” user of the server. Are you trying to connect as root? Or as a regular user?
Obfuscating the IP address makes sense, but we need to know if you’re using root or some other user to connect.
Typically, I will ssh to a remote server as an unprivileged user and su to root if I need to.
I think my username is considered a "super user"? Its the main user for the server. I am not typing "root" when I login using putty. Since I can't get the transfer tool to connect and finish, there must be an issue but I don't know where to look.
That would allow you to connect once and only once with SSH to port 2222 and all the connection information would be logged to the file there /tmp/sshd.log. Hopefully that would also contain the reason for disconnection, if it pertains to the SSH daemon. If it is a matter of PAM, then it may still provide that much.
See "man sshd" for a more authoritative explanation of those options.
In Putty, change "Close window on exit" to "Never" before connecting, then you'll be able to see if there's any diagnostic messages being output.
I changed that setting. Now it says "Putty fatal error. Server unexpectedly closed network connection".
Another thing I noticed, it is not reporting any connections for my usuername but if i enter an incorrect password it will.
I contacted my service provider of my VPS. They recommended repairing or reinstalling SSH. Does that sound like a possible fix?
I contacted my service provider of my VPS. They recommended repairing or reinstalling SSH. Does that sound like a possible fix?
It sounds like generic "I don't know what's up" advice to me. It may help or may make things worse.
I don't remember if WHM provides a browser-based SSH interface - if it does, I'd use that to try what Turbocapitalist posted and see if that provides further information.
Or try enabling SSH access for another account in case it's a user-specific issue. (I'm assuming you have enabled and successfully used SSH previously for the account currently having trouble.)
Otherwise, whilst uninstalling SSH, purging all config, then re-installing it *might* solve the issue, it might also screw up the link between it and cPanel/WHM and cause other issues (either now or at the next upgrade).
cPanel is a paid product - if you're not paying for it, your hosting provider is - so you might as well take advantage of that to get the advice of those that know the product better than anyone here.
That would allow you to connect once and only once with SSH to port 2222 and all the connection information would be logged to the file there /tmp/sshd.log. Hopefully that would also contain the reason for disconnection, if it pertains to the SSH daemon. If it is a matter of PAM, then it may still provide that much.
See "man sshd" for a more authoritative explanation of those options.
Have you ever successfully connected to the server with ssh? With this user - or any user?
Yes I have. I rarely use it. I just need to now because i am transferring servers. Same settings on my new server with Putty and can log in there. So its not a network or firewall issue.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.