Connect Server Using Terminal & SSH

Using terminal we are going to establish a remote connection to a Remote Server like (Droplet, E2C or any cloud vm).

If you are using Linux or Mac you are good to go but in windows you should download git-bash.

1) Now to generate your SSH key type hi…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Akilesh

Using terminal we are going to establish a remote connection to a Remote Server like (Droplet, E2C or any cloud vm).

If you are using Linux or Mac you are good to go but in windows you should download git-bash.

1) Now to generate your SSH key type his commends in your terminal.

It's better to generate SSH keys inside .ssh folder


ssh-keygen

2) Now name your key

you can name your key what ever suits for you

3) Don't need any passphrase

Image description

We have generated two files public key & private key

  • public key - Used by the Server

  • private key - Used by the Client

Image description

4) Open the public key files


cat ur-key-name.pub

Image description

We need to provide our public key to the remote server by opening it in terminal and copy the phrase.

Image description

5) To establish connection between client with server


ssh -i ./droplet-ssh-key root@157.245.104.56

Abbreviation: ssh -i keyfile target_machineusername@host

What's the meaning of -i in ssh?

By providing the private keyfile and our server username and ip address we are opening a connection between client and server

Image description

If you see the above message we have successfully connected our client with the server

Bonus

You can check your system specification with this commends


free -h


df -h


lscpu

To terminate the session enter exit in terminal.


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Akilesh


Print Share Comment Cite Upload Translate Updates
APA

Akilesh | Sciencx (2022-12-04T18:30:00+00:00) Connect Server Using Terminal & SSH. Retrieved from https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/

MLA
" » Connect Server Using Terminal & SSH." Akilesh | Sciencx - Sunday December 4, 2022, https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/
HARVARD
Akilesh | Sciencx Sunday December 4, 2022 » Connect Server Using Terminal & SSH., viewed ,<https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/>
VANCOUVER
Akilesh | Sciencx - » Connect Server Using Terminal & SSH. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/
CHICAGO
" » Connect Server Using Terminal & SSH." Akilesh | Sciencx - Accessed . https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/
IEEE
" » Connect Server Using Terminal & SSH." Akilesh | Sciencx [Online]. Available: https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/. [Accessed: ]
rf:citation
» Connect Server Using Terminal & SSH | Akilesh | Sciencx | https://www.scien.cx/2022/12/04/connect-server-using-terminal-ssh/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.