2.1 - Configuring the Windows SSH Client
- Generate ED25519 Key and upload it to the remote server:
(local machine)
ssh-keygen -t ed25519 -o
Get-Content \path\to\<key-name>.pub | ssh user@remote_server "cat >> .ssh/authorized_keys"
<type user password>
- Add a new host in
C:\Users\<username>/.ssh/config
:
Host <hostname>
HostName <IP Address>
Port <Port>
User <Username>
IdentityFile <Private Key File Location>
- Install OpenSSH Client and Server:
Get-WindowsCapability -Online | Where-Object Name -like ‘OpenSSH*’
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
If an error, run: Add-WindowsCapability -Online -Name "Msix.PackagingTool.Driver~~~~0.0.1.0
2.2 - Setting up Windows OpenSSH Authentication Agent
- Enable the OpenSSH Authentication Agent
Go to Services > OpenSSH Authentication Agent
Right click > Properties
Set Startup Type to Automatic
Start the Service
- Add the key to the authentication agent.
ssh-add /path/to/<key-name>
This might be less secure than requiring the password to use the key each time, but this is why 2FA is also required.
2.3 - Creating Profiles in the Windows Terminal
- Open up settings
- Add a new profile
- Configure it and save.
- Click Open JSON and tweak the profile to contain the following:
{
"name": "<name>",
"tabTitle": "<Tab Title>",
"commandline": "ssh <Profile>",
"icon": "<emoji or file>"
},
Nerd Fonts These are necessary for Starship
2.4 - Setting up VSCode for Remote Connections
- Install it from the official website.
- Main plugin needed is Remote - SSH for remote access. Also helps to install Remote - SSH: Editing Configuration Files for visuals.
- Use the Remote Explorer Tab to view possible SSH servers provided by the file in
C:\Users\<username>/.ssh/config