As I understand there are two ways how one can log into the ssh server:
1. using the private key/public key system, where public key is stored in the remote device and private key is located in the local host and protected with a password
2. without public key stored in the remote device and then user has to send the password to the remote device in order to log in
Please correct me if I'm wrong. However I installed
rancid(which includes
clogin) and configured it accordingly:
1) PC:~ # printf 'add password * PASSWORD PASSWORD\nadd method * {ssh} {telnet:23} {rsh}\n' > /root/.cloginrc
2) PC:~# for ((i=1;i<=24;i+=1)); do printf 'configure terminal\ninterface Fa0/$i\nno description\nend\n"; done > /tmp/conf'
3) PC:~ # ./clogin -autoenable -x /tmp/conf 192.168.1.1
And after the installation I can easily make automated telnet login scripts
However, I have an issue with ssh. I am trying to set up automatic ssh login to a Cisco router using
clogin. However, clogin stops at the "Enter passphrase for key '/root/.ssh/id_rsa':" line. Odd part is that if I type anything the letters are seen(they shouldn't while typing in ssh password). I can cancel this "login" with Ctrl+C. Looks like ssh is attempting to use key-based authentication, and that root's private ky is protected with a password. Is it somehow possible to enable automatic ssh login using
clogin while at the same time keep the key-based ssh authentication?