about « all posts

How to Connect to a Remote Server!

Aug 1 2020 · 2 min read
#software

Need to quickly learn how to connect to a remote server?

This post will show you how to (1) connect to a remote server, and 2) 1mount the server folders on your computer on Windows/Linux.

Table of Contents

1. Access via ssh (Secure Shell)

Prepare three things: 1) the username of your server account, 2) the server IP address, and 3) the password associated with the account, if applicable.

Open your shell. On Windows, this could by the Command Prompt or the Powershell.

The command is “ssh” followed by your server username, “@”, and the server ip address. After which, you may be prompted by the console to input your password.

It should look something like the following:

$ ssh username@125.950.26.789
password:

After placing your password, you should be connected. Congratulations!

NOTE: This connection is temporary and will be gone once you exit the shell, or when your machine is powered off or loses connection to the internet. If so, you will need to enter the command again.

2. Mounting server files via sshfs

SSHFS is Linux-based and doesn’t come installed. See below on how to install it, and the command to mount server files on your computer.

On Windows

First, download and install google’s latest win-sshfs package by clicking here. After doing this, you can simply input the following into your command line.

net use \\sshfs/username@ip_address//

## More examples
# To connect at specific file path
net use \\sshfs/username@ip_address/path/to/file

# To enter password with command
net use \\sshfs\username@ip_address//file-path /user:username password    # space between file path and /user: argument

# To restore connection whenever booting
net use \\sshfs/username@ip_address// /persistent:yes
NOTE: On windows, "net use" is the command used to map network drives to your computer.

On Linux

Similar to Windows, you have to install sshfs for Debian, but this can all be done in the terminal! Follow the steps below to install, then mount the remote server on your machine…

# Install SSHFS
sudo apt-get install sshfs

# OPT: Create directory to mount server files on
sudo mkdir /mnt/mydir

# Mount
sudo sshfs -o allow_other,default_permissions username@ip_address:/file_path /mnt/mydir
NOTE: Be careful of spaces!

Additional Resources


1mount ::= having the remote server’s files on your local machine, accessible by file explorer.