Connecting to Linux SSH using Windows Terminal

In later Windows, you can now use SSH from PowerShell
Connecting to Linux SSH using Windows Terminal

Windows Terminal / PowerShell

Open up Windows PowerShell, either in Terminal or directly

Connecting to server

Now you want to connect to your host

#Command ssh [username]@[ip-address]

#Example ssh [email protected]

If it's your first time connecting, you might be asked if you want to trust the connection. If you are sure it's the right server, enter yes to trust it

The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. ECDSA key fingerprint is SHA256:bSZ2Q+jdiowøajdoijef2389jfer+tWK28A. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])?

Next you'll be asked to enter your password

Congratulations, now you're connected to the server

Use other port than 22

If your server is not using the standard SSH port 22, then you need to define what port to use

#Command ssh [username]@[ip-address] -p [port-number]

#Example ssh [email protected] -p 1234

Now you'll connect over port 1234, instead of port 22

Reconnecting

20230629_1001_649d193decbcd.webp

Next time you want to connect, just start typing SSH and you'll get a suggest for your last connection

If you want to reconnect, just press arrow left and it will be populated. Then press enter to connect as normal

Exiting connection

Once you're done, you can use exit or logoff

Sending single command

You can also send single commands, that will return result without leaving the connection open

#Command ssh [username]@[ip-address] [command]

#Example ssh [email protected] ls

This will return a list of everything in default login directory

Sending multiple commands

You can also send multiple commands, that will return result without leaving the connection open

ssh [username]@[ip-address] "[command-1]; [command-2]; [command-3]"

Here it's important that each command is ended with semicolon ; and that the entire command section is surrounded by double quotes "

Other options

If you're running an older versions of Windows or just don't want to use SSH in PowerShell. There are still other options, such as the classic Putty or installing a Linux distro onto your Windows, then connecting from there

We sometimes publish affiliate links and these always needs to follow our editorial policy, for more information check out our affiliate link policy

You might also like

Waking up during the night to pee could mean you're peeing wrong
Health

Waking up during the night to pee could mean you're peeing wrong

Powder vs Liquid vs Capsul Detergent
Cleaning

Powder vs Liquid vs Capsul Detergent

Arme riddere (Norwegian Cinnamon Toast)
Breakfast

Arme riddere (Norwegian Cinnamon Toast)

Comments

Sign up or Login to post a comment

There are no comments, be the first to comment.