Friday, October 14, 2011

Using ssh id_rsa without password - another username

Just had to login to another box via ssh, but the other account has a different username than my current one. Further, had to use a different id_dsa / id_dsa.pub set of files. I couldn't figure this out for a while. Turns out, the right way to do this is:
  • generate the keys
  • copy the pub key into authorized_keys2 on the remote box
  • ssh -i ~/.ssh/privateKeyFileName otheruser@remoteboxname
Pretty straightforward, found out. Kinda cool - didn't know about the -i parameter.

No comments: