#Create a new keypair: (go with the defaults) ssh-keygen #Copy the public key to the server: (password for the last time) ssh-copy-id user@my.server.com #From now on the server should recognize your key and not ask you for the password anymore: ssh user@my.server.com visudo username ALL= NOPASSWD: /sbin/shutdown #Script zum Aufruf: ssh -tt username@pcname 'sudo shutdown -h now'