Python script to check ssh login on multiple hosts against a common password

Content has been moved to new link : https://theg-technical.blogspot.com/2018/09/python-script-to-check-ssh-login-on.html

sftp : connect to a server

Use the below command to connect to a sftp server from shell :

sftp -oPort=port_number theg@IP

To connect via Filezilla :

host : sftp://IP

username : username

password : password of your account

port : port number

SSH Cant Connect : Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password

If you have installed keypair and the remote machine still asking for the password, you can follow the below steps.

You may see the following errors:

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic

The reason behind the issue is the user's home directory is encrypted and the connecting machine can't access the keys. So you need to change the location of the key to somewhere else.

mkdir /etc/ssh/theg

cp ~/.ssh/authorized_keys /etc/ssh/theg/

Edit /etc/ssh/sshd_config

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      /etc/ssh/theg/authorized_keys

Restart the ssh service:

service sshd restart

Try logging now. Enjoy !!! 🙂

ps : use the verbose option in ssh to get more details : ssh -C root@IP -v