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!

Are your smart devices spying on you? Make better purchasing choices and find products that respect your privacy at Unwanted.cloud

RSS Latest posts from my personal blog


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.)

Full-stack impostor syndrome sufferer & Software Engineer at Schibsted Media Group

Comments 1