Use SSH to Connect to a Remote Server in Ubuntu

Published by 小楼临风 on

Login to your server

ssh remote_username@remote_host -p port

Enter the following into the command line to create ssh key

ssh-keygen -t rsa

Your keys will be created at ~/.ssh/ and ~/.ssh/id_rsa.

the id_rsa file is readable and writable only to the owner. This is how it should be to keep it secret.

The file, however, can be shared and has permissions appropriate for this activity.

touch authorized_keys
chmod 600 authorized_keys
cat >> authorized_keys

save id_rsa to local and configure your local .ssh config file, then you are ready to go.

Host server
    HostName remote_host
    User username
    Port server_port
    IdentityFile where_id_rsa_place

Categories: Uncategorized


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.