thanks guys that works but i do want to do a little bit more.
how would i incorporate the following:
scp ~/.ssh/id_dsa.pub server1:~/.ssh/authorized_keys
so basically the logic is:
1. create directory if it doesn't exist on server1 which now i know can be done via:
Code:
ssh $i /bin/mkdir -p .ssh
2. once directory is created copy id_dsa.pub as authorized_keys to .ssh folder in server1
which also can be done via:
Code:
scp ~/.ssh/id_dsa.pub server1:~/.ssh/authorized_keys
so my questions is how do i combine the two in a script?