Linux Tricks and Techniques

For Linux Experts

Use the website for easy leaning of Linux

Friday, 3 June 2016

SSH Login Failure in Linux

SSH Login Failed

Some time we may get an ssh login issue in the Linux server which becomes very critical sometimes if it is for main production server of the organisation. If we are able to ping the server from command line that means its not a network issue we need to do it from OS level. If a root user is not able to login to server from putty then we need to login to console to access the server. if still not able to take the console then reboot the server and take it in to single user mode and follow the below steps:

1.SSH login failed 

Issue details: 1.Not able to login from putty
                      2. But able to ping the server.


1. Take the server in to single user mode by editing kernal line press e

2.Write s in the end of line just after the rhgb quiet and press enter key that will bring in grub bootloader screen

3.Press b will take you to single user mode.

4. Reset the root password and try login and if not able to login then go to

# vi /etc/pam.d/system-auth and comment the lines.

# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
#auth        required    deny=3   onerr=fail  unlock_time=1800
auth        required
auth        sufficient nullok try_first_pass
auth        requisite uid >= 500 quiet
auth        required

#account     required
account     required
account     sufficient uid < 500 quiet
account     required

password    requisite try_first_pass retry=3
password    sufficient md5 shadow nullok try_first_pass use_authtok
password    required

session     optional revoke
session     required
session     [success=1 default=ignore] service in crond quiet use_uid
session     required

5. Check for the ssh service

Also check the /var/empty/sshd permission or compare with other server as it should be 711.

#restart  the ssh service

#reboot the server

No comments:
Write comments