Useful Snippets

Welcome!


This blog is used to collect useful snippets related to Linux, PHP, MySQL and more. Feel free to post comments with improvements or questions!

RSS Latest posts from my personal blog


Most viewed posts


Subscribe to RSS feed


Simple password-less SSH login by pushing your key to remote server

Stanislav KhromovStanislav Khromov
ssh-copy-id <username>@<host>

Don’t forget to create your SSH key first.

Example:

root@odroidu2-1:~# ssh-copy-id pi@192.168.1.146
pi@192.168.1.146's password: (enter password)
Now try logging into the machine, with "ssh 'pi@192.168.1.146'", and check in:

  ~/.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

root@odroidu2-1:~# ssh pi@192.168.1.146
...
pi@rpi-torrent ~ $

More info
Use ssh-copy-id when SSH port is not 22. (Custom port.)

Web Developer at Aftonbladet (Schibsted Media Group)
Any opinions on this blog are my own and do not reflect the views of my employer.
LinkedIn
Twitter
WordPress.org Profile
Visit my other blog

Comments 1