logo

How to Connect to an SSH Server via CLI 📂Programing

How to Connect to an SSH Server via CLI

Guide

Let’s say the IP of the server you’re trying to connect to is 192.168.1.1.

ssh user@192.168.1.1

Enter the above command in the terminal1.

Caution for Windows Servers

Using Windows as a server, unlike Linux, there’s a bit annoying and concerning part.

  • user: It implies the name of the account that has permission to access the server. It might be the first five letters of an account existing on that computer (but not necessarily). The biggest difference between Windows and Linux is the convenience of synchronization through a Microsoft account, which makes it quite confusing when using the command line interface. It’s the username, not the computer name, and if the account I’ve synchronized on the server is ‘rmsmsgood@gmail.com’ and has a Korean nickname, then there’s a high chance that the account name is automatically shortened to ‘rmsms’. The most certain method is to go directly into C:\Users and find the account name I want to access. Basically, if both the client and server you are connecting to are Windows and synchronized with the same account, the user name will also be the same, so just typing ssh 192.168.1.1 would work.
  • Password: It’s not the PIN number of that computer but the actual password of the synchronized ‘rmsmsgood@gmail.com’. For instance, if the IP is 192.168.1.1 and the server computer name is server7 with the account’s PIN being ‘1234’ and ‘rmsmsgood@gmail.com’s password ‘asdf77’, then to connect to the server, one of the following two commands can be used, and the password ‘asdf77’ should be entered.
ssh rmsms@server7
ssh rmsms@192.168.1.1

Connecting through a Different Port

ssh user@192.168.1.1 -p 22

Just add the port number after the -p option2.