Jun 18, 2013

ssh-key exchange with remote server for password less authentification

long time ago with no update, ok - i guess its a good day to do some.. :p

most it-admins are confronted with doing some ssh-sessions to their remote servers.
time costs money, so if u like to get more comfortable with connecting to them, here is a little tutorial from me that will treat ssh authentification with public keys.

on the ssh-client: ( im currently logged in with my root acc )

#cd .ssh/
#ssh-keygen      # will generate your public key
#cat *.pub | ssh root@IP-of-RemoteServer 'umask 077; cat >>.ssh/authorized_keys2

after all your public key will be copied to the remote host.

on the remote-host:

edit your /etc/ssh/sshd_config

be sure that the following options are enabled.

PubkeyAuthentication yes
AuthorizedKeysFile  ~/.ssh/authorized_keys2   # the key path should be the same like on the client


to test your setup, just do a ssh username@RemoteServer

from now you shouldnt be asked for a user / pass.

No comments:

Post a Comment