Monday, 3 December 2012

Connection to the server closed after providing password[vps servers]

When trying to ssh to a server, it asked for the password and upon providing the password we got the message “Connection to the server closed”. The password provided is correct. If this error occurs, make sure that it is a VPS by accessing the WHM and checking the Disk usage. If it shows the device as “/dev/simfs”, then you can confirm that it is a VPS.

Locate the hardware node of the VPS and login to the node. Try logging into the VPS by executing the command

 vzctl enter VEID
Then you will receive the error

Unable to open pty: No such file or directory
In such case, run the following commands to fix it:

 vzctl exec VEID /sbin/MAKEDEV pty
 vzctl exec VEID /sbin/MAKEDEV tty
 vzctl enter VEID

To fix the issue permanently,

1. Edit the file /etc/rc.sysinit of the VPS server

2. Comment the line

3. Add the following lines after /sbin/start_udev:

 /sbin/MAKEDEV tty
 /sbin/MAKEDEV pty

4. Reboot your VPS

 vzctl restart VEID