Client server automatic connection
You need an ssh-agent running on your client
Go home
Concept
The file authorized_keys contains the keys list. It may be copied among all servers
server>cd; mkdir .ssh; cd .ssh; touch authorized_keys
Issue this command, when prompted for password press enter twice
#DO NOT OVERWRITE AN EXISTING KEY; ANSWER NO!
client>cd; cd .ssh; ssh-keygen -t rsa; ssh-keygen -t dsa
Enter file in which to save the key(/home/oracle/.ssh/id_rsa):
Created directory '/home/oracle/.ssh'.
Generating public/private rsa key pair.
Enter passphrase(empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
md5 1024 9f:a8:d5:85:51:aa:de:b1:7d:f9:b7:d7:ac:1b:a5:73 oracle@db017ops
client>
scp $HOME/.ssh/id_rsa.pub oracle@server:/home/oracle/.ssh/id_rsa.pub.tmp
#Copy and paste the two lines separately
scp $HOME/.ssh/id_dsa.pub oracle@server:/home/oracle/.ssh/id_dsa.pub.tmp
oracle@db035ops's password:
id_rsa.pub 100% |*********************************************************************************| 225 00:00
server>cd; cd .ssh; cat id_rsa.pub.tmp >> authorized_keys; cat id_dsa.pub.tmp >> authorized_keys; rm id_*sa.pub.tmp
Testing
#Do not skip testing, you need to answer "yes" when prompted for new host addition
client> ssh linuxes1 "date;hostname"
Resulting authorized_keys example
ssh-rsa AAA...uantc= oracle@node1.fadalti.com
ssh-dss AAAA...vsHIA== oracle@node1.fadalti.com
|