create ssh rsa key files and use them for authentication

Create the rsa key, if ~/.ssh directory doesn’t exit yet, create it by mkdir ~/.ssh

cd ~/.ssh
ssh-keygen -t rya -C put your email address or a username or any kind of label text

After you entered the above command it give you the prompt below, just press enter or type a file name you like and then enter.

Enter file in which to save the key (/home/yourusername/.ssh/id_rsa)

After you entered above, it will ask you to enter a passphrase, you can either skip it by press enter or create one by giving a passphrase and give one more time to confirm.

Now you should have have the file id_rsa and two files created in ~/.ssh


Done creating your rsa key files. The below are for setting up rsa pub key authentication for accessing remote server if you are the owner of the remote server. Otherwise, you just have to give the file to your system admin of the remote server and he/she can set it up for you.

Assume you have an account on a virtual host or remote server at /home/yourname/, logon to the server and copy the content in your that you just created from the above to the file on the remote server /home/yourname/.ssh/authorized_keys

cd ~/.ssh
vim authorized_keys

Go back to your local machine, assume the remote server ip is, then you can logon by this command, which will not ask you for a password because it will use your for authentication. It will ask you a passphrase if you created passphrase when you were creating the rsa key files.

ssh yourname@

Another quicker way to logon is to set ssh config file. Create a file ~/.ssh/config and put this in it

Host someservername
   User yourname
   IdentityFile ~/.ssh/id_rsa

Now you can logon by

ssh someservername

Download a file from the remote server like this

scp someservername:/home/yourname/somefile.txt ./

Upload a file from your local to the remote server like this

scp somefile.txt someservername:/home/yourname/

Search within Codexpedia

Custom Search

Search the entire web

Custom Search