First generate public and private key pairs on your Terminal.
This can be done through ssh-key gen command on terminal.
After key-gen command give name to the file like i did as k.pub (public key) & k (private key) or press enter for default names like id_rsa(private key) & id_rsa.pub(public key).
Let’s consider you are using Digital Ocean to borrow a server online.
> Go to Create button and press on Create Droplet.
> Choose your Data Center location
> Choose the plan you want:
> Select Ssh key for authentication
> Press New Ssh Key to add your public key!
How to get your public key to paste it here?
> Go to your terminal navigate to .ssh folder with following command:
> Be on your root directory on terminal
cd .ssh
To see the contents of the folder:
ls .ssh (ls -la ~/.ssh does the same thing)
>> Enter cat file_name to open the public key file (id_rsa.pub) & copy it!
cat id_rsa.pub
>> Copy the public key (Control C)
>> Paste it to where is needed on Digital Ocean:
>> Press on Add SSH key and Create Droplet!
>> After the Droplet is created copy the Ip address clicking on ‘Copy’:
>> Go to your terminal and type :
ssh root@ip_address_you_copied
>> if it’s first time it will ask to set a password (set a easy password)
First generate public and private key pairs on your Terminal.
This can be done through ssh-key gen command on terminal.
After key-gen command give name to the file like i did as k.pub (public key) & k (private key) or press enter for default names like id_rsa(private key) & id_rsa.pub(public key).
Let’s consider you are using Digital Ocean to borrow a server online.
> Go to Create button and press on Create Droplet.
> Choose your Data Center location
> Choose the plan you want:
> Select Ssh key for authentication
> Press New Ssh Key to add your public key!
How to get your public key to paste it here?
> Go to your terminal navigate to .ssh folder with following command:
> Be on your root directory on terminal
cd .ssh
To see the contents of the folder:
ls .ssh (ls -la ~/.ssh does the same thing)
>> Enter cat file_name to open the public key file (id_rsa.pub) & copy it!
cat id_rsa.pub
>> Copy the public key (Control C)
>> Paste it to where is needed on Digital Ocean:
>> Press on Add SSH key and Create Droplet!
>> After the Droplet is created copy the Ip address clicking on ‘Copy’:
>> Go to your terminal and type :
ssh root@ip_address_you_copied
>> if it’s first time it will ask to set a password (set a easy password)
>> enter the password!
>> BOOM! you’ve accessed your server