Create and install ssh key on linux

# On the client (ie. your pc)..

# if .ssh directory doesn't exist yet..
mkdir /home/fred/.ssh
chmod 700 /home/fred/.ssh

# generate the key..
ssh-keygen -q -t rsa -b 2048 -f /home/fred/.ssh/id_rsa

# if you didn't create it as 'fred'..
chown -R fred:fred /home/fred/.ssh

# copy the public key..
cat /home/fred/.ssh/

# Install on the server..

# paste key into..

Now you can ssh to your server using that key.


Looking for great online sysadmin training in Linux, Security & Hacking and many others?