SSH connections,... and forget about passwords!

SSH hodor

If you don't understand it, this blog is not for you

This guide is essential to our daily with SSH connections, but sometimes we become lazy (I'm the first).

I explain VERY EASILY how to generate keys you need so you don't have to write the damn password in each SSH connection.

Let's create the public/private keys and copy the first on the remote computer. Wrote the following from the computer where we are going to connect (in my case, a Mac):

cd .ssh
ssh-keygen -b 1024 -t rsa -f id_rsa -P ""
ssh pi@ < ~/.ssh/ 'mkdir -p .ssh && cat >> .ssh/authorized_keys'

OSX Terminal showing all the process. Click to enlarge

With the last command, we copy from our Linux/OSX the public key to the remote device. In this example, (my Raspberry Pi).


It was not so hard, right?. Why have you don't this before?.

If you want to type less, create an alias in your Linux/OSX: nano ~/.bash_profile

Example: alias sshrpi='ssh pi@'

And reload the shell with: source ~/.bash_profile

Now, every time you type sshrpi, will access from your computer to the Pi with no password.



Link: > Passwordless SSH access

I request your permission to obtain statistical data on its navigation on this website. If you continue to browse I consider you accept the use of cookies. This site is adapted to be compliant with the new law about General Data Protection Regulation. OK | More Information