Veracious Network More than just a game, it's a community!

Howto use SSH with a graphical app from Windows

The game servers we offer to clients usually run Linux for cost and performance reasons, but one of the common complaints from people is that managing the files on those servers is too difficult. "I can't just drag and drop files to it" or "There's no graphical interface to browse files". This guide will provide a couple tools to hopefully alleviate those issues.

Option 1: Connect to SSH with Username and Password

The easiest method for connecting to a server via SSH is simply via username and password. With this method, you can ignore any steps necessary for creating and uploading a key pair, (but be aware that your system administrator should have disabled logging in remotely with a password for all users).

Powershell SSH with Passwords (Yeah, not much of a graphical interface, but be patient; we'll get there.)

Option 2: Generate Key Pairs with SSH

The more secure option is to use key pair files; a public string that gets shared with the server you would like to connect to and a private key file which remains on your local device.

As of Windows 10, Microsoft has included native support for this feature, (only took them a couple decades to catch up). Just open a Powershell window and run ssh-keygen.

SSH Keygen from Powershell

This will generate a private and public key on your local computer in the .ssh directory in your home directory. (You may need to search for it, as Microsoft doesn't just give you a home quick access link...)

Windows SSH key

Here, the default key was an ed25519 key file; other options can be rsa, dsa, ecdsa, or a variety of others; but they all effectively operate the same. The important note is that the .pub file is the public key which can be shared and the file without the extension is the private key which should never leave your directly controlled device, (or a secure backup).

For more security, a pass phrase can be added when creating the key; this will require your pass phrase anytime the private key is used to authenticate with something.

(Side note, the .pub file is just a plain text file that can be opened with notepad, despite what Microsoft Publisher tries to tell you.) The contents of the public key is just a text file that contains the encryption type, public fingerprint, and an identifier for the key; all of which constitute your public key.

Get-Content $HOME\.ssh\id_ed25519.pub

SSH Key Powershell

Install Public Key

Once you have your public key, copy that to the server that you wish to connect to or just request your admin to enable the key for your user account. Some VPS management dashboards will offer a UI to do this, but this will assume you are not using one of them.

(This is one of the trade offs of using public/private key pairs when password authentication is disabled. You need system-level access to enable the key, but you need the key enabled before you can access the system...)

As such this will assume that you have some method of access the command line of your server, probably from a web terminal. In this guide, we will also assume the username you are connecting to is steam, but replace that with the username you will need to use.

If you are connected as the target user, ensure the target directory exists and open an editor to paste in the public key.

mkdir -p ~/.ssh && nano ~/.ssh/authorized_keys

If you are connected as root or another admin user, use sudo to run the operations as the target user.

sudo -u steam mkdir -p /home/steam/.ssh
sudo -u steam nano /home/steam/authorized_keys

Add your public key into that file and save/exit the editor.

(Side note, Linux and MacOS clients have ssh-copy-id which does all the hard work for you, but Microsoft hasn't quite caught up to that yet.)

Setup Client

While Windows has native support for SSH, Microsoft sadly does not provide a native GUI for accessing SFTP files. Two common options are Filezilla and WinSCP.

We recommend WinSCP as it is published under the GPL and therefore the source code can be audited for security and it just feels less scammy/ad-infested than Filezilla.

Install WinSCP

Download the official WinSCP client or from their GitHub page and install. You will have the option of Commander or Explorer styles.

Commander is a two-pane view with local files on one side and remote files on the other.

Explorer is a more traditional Windows file explorer style with a single pane being used for viewing remote files where you can drag/drop files between the explorer pane and your local desktop or directories.

Connect to Server

Once installed open WinSCP and you will be presented with a login screen for a new connection. Add your IP address, enter steam as the username, and ensure that SFTP is selected.

winscp-step1.png

If you chose to use password authentication, enter the password and skip to Save Connection.

Key File Setting

When using key pair authentication, leave the password blank and click on Advanced.
Scroll down to SSH and select Authentication.

winscp-step2.png

Browse to your private key (C:/Users/YourUserName/.ssh/id_ed25519) and select it. Note, this is NOT the .pub file, but is the file without that .pub extension.

WinSCP will complain that the key is in the wrong format, but provides a button to auto-convert it.

winscp-step3.png

Just accept that and save the private key in the format WinSCP wants.

OK through that and close to the login screen.

Save Connection

Save the connection as something you will remember and click Login to attempt to connect to the server.

If everything was done correctly, you will be presented with a warning that the server is unknown. This is expected as you have never connected to it before.

Go ahead and accept that and you should be presented with a file browser

winscp-step4.png

Once connected, you can browse through files, download, upload, and edit whatever you need, all from the comfort of a pretty graphical user interface!

Key files offer better security, and can provide better convenience for users who frequently connect into servers.

Powershell SSH with no passwords

Using SSH to access your server's command line no longer prompts for the password! This is because $HOME\.ssh\ is the default system path for SSH keys and is used automatically by most scripts that rely on SSH.