SSH login without password
You set up a cron job and searching for -p
parameter to pass ssh, for auto login. There is no such parameter. But there are many mechanisms to allow us authonize throgh. Like RSA autothentication.
The logic is give your public key to other host. Then it will identify you and let you pass in.
You want to backup server to rsync DB server to update lastest db dumps. I've created backupUser at DB server and File servers.
On backup server create RSA key.
ssh-keygen -t rsa
It will create both private key and public key, the former will be put to DB server
Generating public/private rsa key pair.
Enter file in which to save the key (/home/nerkn/.ssh/id_rsa):
Accept the file path. Then it will ask passphase ( which is password you want to use). Since you dont want passphase pass it alone by entering enter.
Now you have public key, I cat contents and copied. Then login to DB server to paste it.
nano -w .ssh/authorized_keys
Paste your public key.
If there is no .ssh folder, ssh back to the backup server. You wont bother permissions of .ssh folder. When you accept it as a known host.
Log off. And give a try.
If you again need to enter password. You should tweak your DBServer to accept RSA auth. mechanism.
nano -w /etc/ssh/sshd_config
Only one of my servers, RSA auth is not by default.
Find and change
Log off and try again.
if it doen't work anyway, you can investigate what is going on while authentication ask for the verbose mode.
ssh -v backupUser@DBServer
It's like magic. That there is no prompt for you to enter pass.";