Introduction to Bioinformatics: How to Remotely Login to Linux Server

After purchasing the server and placing it in the machine room, and having the account and password, the question arises: how can we remotely log into the Linux server from our own computer?

How to Remotely Login to Linux Server from Windows

To remotely log into a server from a Windows system, I have used various terminal software for logging into Linux servers, such as PuTTY, SSH Secure Shell Client, Xshell, etc. These software are currently the most commonly used SSH clients, each with its own strengths.

PuTTY + MTPuTTY

PuTTY is a software for connecting via Telnet, SSH, rlogin, pure TCP, and serial interfaces. Earlier versions only supported the Windows platform, but recent versions have begun to support various Unix platforms, with plans to port to Mac OS X. In addition to the official version, many third-party groups or individuals have ported PuTTY to other platforms, such as mobile phones based on Symbian. PuTTY is open-source software mainly maintained by Simon Tatham and is licensed under the MIT license. With the increasing popularity of Linux in server applications, Linux system management increasingly relies on remote access. Among various remote login tools, PuTTY is one of the outstanding ones. PuTTY is a free Telnet, SSH, and rlogin client for Windows x86 platforms, but its functionality is not inferior to commercial Telnet-like tools. The latest version is 0.70 latest release [1] (Baike).

Introduction to Bioinformatics: How to Remotely Login to Linux Server

PuTTY is a lightweight software that does not require installation; you can use it by double-clicking. In the login interface, enter the server’s IP address and click Open to connect to the server. Then enter the username and password as required to successfully log in to the server.

MTPuTTY is a multi-tab plugin for PuTTY.

Official website: http://www.ttyplus.com/multi-tabbed-putty/

It allows you to open multiple sessions on one page.

However, PuTTY lacks some extra features, such as direct SFTP file transfer and tab switching. Generally, you need to use third-party SFTP tools like FileZilla or WinSCP separately.

The following is the interface of WinSCP. You can download it to your computer to upload and download data yourself! Download link: https://winscp.net/eng/download.php

Introduction to Bioinformatics: How to Remotely Login to Linux Server

MobaXterm

I recommend a powerful all-in-one terminal tool for Windows—MobaXterm, which has very strong functionality.

Here’s a brief introduction to MobaXterm for your reference.

Built-in SFTP File Transfer

When using SSH to connect to a remote host, the SFTP connection will automatically start on the left side, listing the file list on the server without any configuration, allowing direct upload and download.

Introduction to Bioinformatics: How to Remotely Login to Linux Server

We can see that the command line window and the SFTP file transfer window are combined, making it very convenient to view the file status in real-time while processing data.

Moreover, when you switch the command line window, the file transfer window on the left will also automatically switch to correspond with the command line window, ensuring you can keep track of the current working directory of the command line window.

Conveniently, when you check the “Follow terminal folder” option in the lower left corner, when you use the “cd” command in the command line window to change the path, the file transfer window’s path will also automatically switch to the current path.

Introduction to Bioinformatics: How to Remotely Login to Linux Server

MobaXterm login server interface

Automatically Associate Windows Software with Files

MobaXterm comes with a text editor. You can double-click text files in the file transfer window to open them directly with the built-in text editor on the server. You can also directly open software installed on your Windows system, such as PNG files, making it very user-friendly.

Introduction to Bioinformatics: How to Remotely Login to Linux Server

MobaXterm’s text editor

Built-in X Server

MobaXterm has a built-in X server that can directly execute X window programs from the remote end. It also works automatically with the SSH connection without any configuration.

In contrast, if you use PuTTY, you need to download a third-party X server like Xming separately and configure X11 forwarding in PuTTY. You have to open Xming in advance each time you use it, which is quite troublesome.

Introduction to Bioinformatics: How to Remotely Login to Linux Server

Running Firefox browser remotely

MobaXterm Comes with a Linux Environment

You do not need to install a Linux system or a virtual machine; just open the local terminal of MobaXterm to directly enter the Linux environment. Interested friends should try it out!

In summary, MobaXterm’s functionality is indeed powerful, and this software has a free version available for direct download from the official website, making it highly recommended.

How to Remotely Login to Linux Server from Linux/Mac

Login Using Username and Password

When remotely logging into the server, we need to know the server’s IP address, remote connection port number, and username and password for login. Open the command terminal and enter the command:

ssh username@IP_address -p port

Then the system will prompt for a password. After entering it, you can log in. If you do not add the -p option, the default port is 22. You can also use the -l option to input the username:

ssh -l username ip_address -p port

Remote File Transfer Command scp

To upload a local directory to the remote server:

scp -P24 -r /home/test/ [email protected]:/home/test

The -r parameter indicates recursive copying (i.e., copying all contents under that directory), and -P indicates the port number to log into the server, which defaults to 22, but is set to 24 here.

/home/test/ indicates the directory to be uploaded, and [email protected]:/home/test indicates the directory location on the remote server.

Login Using Keys (No Manual Password Input)

First, generate the keys by entering the command in any directory:

ssh-keygen -t rsa -P ''

-P ” indicates an empty password. Then the system will prompt you to input the name for the generated key file. You can enter any name, such as id_rsa, and press Enter.

The system will generate two files, id_rsa and id_rsa.pub, in the current directory.

Create a .ssh folder in the root directory and copy the generated key files there:

mkdir -p ~/.ssh

# -p option means do not create if the folder already exists.

# Then copy both generated files to the .ssh folder
cp id_rsa* ~/.ssh/

Copy the public key file id_rsa.pub to the server you want to log into using the scp command:

scp -P port ~/.ssh/id_rsa.pub username@ip_address:~

Then the system will prompt for a password. Enter it to complete the copy.

Log into the remote server and create a .ssh folder in the user root directory (if it does not exist):

# This creates the ssh folder on the remote server
mkdir -p ~/.ssh
# Add the contents of id_rsa.pub to the authorized_keys file
cat id_rsa.pub >> .ssh/authorized_keys

Log out of the current remote login, and you will then be able to log in remotely without entering the password manually.

How to Remotely Login to Linux Server from Mac

The built-in terminal on Mac is quite good too.

iTerm2 is one of the rare command line tools in the macOS system. Here are a few features:

Introduction to Bioinformatics: How to Remotely Login to Linux Server

Download link: http://iterm2.com/

Select to Copy

The command line we used before either does not allow the use of conventional copy shortcuts or requires selecting and then pressing keys to copy. iTerm2 automatically copies successfully when selected.

Press command + v to paste successfully.

Full-Text Search Function

Just like editing text in a text editor, you only need to press command + f to enter the content you want to search for, and it will highlight and display it in the current command line page, as shown in the figure:

Introduction to Bioinformatics: How to Remotely Login to Linux Server

Search for cpu in the interface to find and highlight all occurrences. Click the arrow on the right side of the search box to cycle through each location.

Split Screen Display

Horizontal split: command + shift + d

Introduction to Bioinformatics: How to Remotely Login to Linux Server

Shortcut Keys

Shortcut command descriptions:

Introduction to Bioinformatics: How to Remotely Login to Linux Server

Color Selection

You can freely choose your favorite colors.

Introduction to Bioinformatics: How to Remotely Login to Linux Server

Related Articles:

Introduction to Bioinformatics: Sequence Alignment with BLAST Online and Locally

Introduction to Bioinformatics: How to Upload Raw Sequencing Data to NCBI

Introduction to Bioinformatics: Detailed Explanation of Fasta and Fastq Format Files

Leave a Comment