Advertisement
Tritonio

Logging in without a password – certificates & ssh

Mar 15th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. A quick how-to, mostly for my reference, but also because a Google search for “using ssh with certificates” brings up no useful resources.
  2.  
  3. To avoid having to type in your password every time you want to ssh to a server, you can set up the server to accept a certificate like this:
  4.  
  5. On your local machine, go to the command-line and type:
  6.  
  7. cd ~/.ssh
  8. ssh-keygen -t rsa
  9. Choose no passphrase when asked and accept the default filename of id_rsa
  10. scp id_rsa.pub <user>@<yourhost>:.ssh/authorized_keys
  11. Provide your password when asked and that’s the last time you’ll have to do it!
  12.  
  13. If you get an error on the last step saying “scp: .ssh/authorized_keys: No such file or directory”, connect to your host and create the .ssh directory in your home directory.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement