How to SSH from Windows Desktop to a linux server - using Powershell


Open powershell, from start menu

to ssh into server using username/password, type:  ssh <username>@<host>      or    ssh -l <username> <server name/ip>    

you will be prompted for the password.


to use your private key:  ssh -i <key file>  <username>@<host>


To Speed common connections up you can create a config file in .ssh folder in your profile c:\users\<username>\.ssh

and have all your common connection info stored in the following format:


Host <hostname>
    User <username>
    Hostname <hostname>
    PreferredAuthentications publickey  
    IdentityFile ~/.ssh/<me>_rsa

e.g.
Host targaryen
    HostName 192.168.1.10
    User daenerys
    Port 7654
    IdentityFile ~/.ssh/targaryen.key

and then you can simply type ssh targaryen to connect. More about how to use config file can be found in https://linuxize.com/post/using-the-ssh-config-file/

To create keys - google search or see section in help : GitLab and SSH