Enable Dark Mode!
how-to-use-ssh-to-connect-to-a-remote-server.jpg
By: Gion Dany

How to Use SSH to Connect to a Remote Server

Technical

There are several ways to connect to a remote computer, depending on the operating system you are using, but the most commonly used protocol is SSH.

SSH (Secure Shell or Secure Socket Shell) is a network communication protocol that allows communication between two systems. Client and server applications use this protocol to establish remote connections. These tools allow you to access other computers, manage them remotely, and transfer files.

Connect to your server using SSH

In a terminal window, run the following command to connect to the server.

ssh user_name@host(IP/Domain_name)

This command connects to the SSH server on the default port 22.

user_name: represents an account that accesses a host.

host: refers to the machine being accessed (computer or router). This can be an IP address (e.g., 20.40.202.16) or a domain name (e.g., cybrosys.com).

Connect to your instance using SSH with port

If your server's SSH port is not 22, you must specify it in the SSH command.

To do this, use the -p option, as shown in the following command.

ssh username@host(IP/Domain_name) -p [port-number]

-p: port to connect to the remote host.

Connect to your instance using SSH with a private key (.pem)

In a terminal window, use the ssh command to connect to your instance. Specify the private key (.pem) path and file name, the instance username, and the instance public DNS name or IP.

Initially give the user read permission to the file.

chmod 400 key-pair-name.pem

ssh -i /path/key-pair-name.pem username@host(IP/public-dns-name)

Putty

Launch the PuTTY SSH client, then enter your server’s SSH Host Name (or IP address) and Port.

how-to-use-ssh-to-connect-to-a-remote-server

Host Name: Domain name or IP address of the destination host.

Port: SSH port of the destination host.

Connection Type: Select ‘SSH’ as the connection type,

Then click on the Open button to open the connection.

After successfully connecting, the terminal should use the server's remote shell environment. The command prompt displays the username and hostname configured for the server. You can now run all commands available on this server.

Transfer files using the SCP client

To transfer a file to a destination on your instance, enter the following command:

scp /source/filename username@host(IP/Domain_name): /destination 

/source/filename is the name of the path and filename which we want to copy the files from.

/destination is the path to the directory where you want to copy the files to.

Copy multiple files

To copy multiple files from one location. To do this, specify the required files in the same command separated by spaces.

scp /source/filename_1 /source/filename_2 /source/filename_3 username@host(IP/Domain_name): /destination

Copy files and directories recursively

Use the -R or -r option to create a target directory and copy all files and subdirectories from the source to the target directory.

scp -r /source/filename username@host(IP/Domain_name): /destination 

Copy files with Non-default Port

If SSH on the remote host is listening on a port other than the default port 22, you can specify the port with the -P argument.

scp -P [port-number] /source/filename username@host(IP/Domain_name): /destination 

Copy files with private key(key-pair-name.pem)

scp -i /path/key-pair-name.pem /source/filename username@host(IP/public-dns-name):/destination

Transfer Files using Filezilla

FileZilla is a File Transfer Protocol (FTP) tool for sending and receiving files between networks. It is a free FTP client for Windows, macOS, and Linux that supports FTP, FTPS, and SFTP.

-Start Filezilla

-Select the file, Then Open the Site Manager button,

-Click the New Site button to create a new connection.

-Enter the login information on the right under the General tab.

how-to-use-ssh-to-connect-to-a-remote-server

After entering all the login information, click Connect.

how-to-use-ssh-to-connect-to-a-remote-server

Once you've connected to the server with FileZilla, transferring files within FileZilla is simplified into a drag-and-drop process.

how-to-use-ssh-to-connect-to-a-remote-server

Click and drag an item from the left local site column to the right remote site column.

Other FTP Applications are used to transfer files between your computer and server:

MOVEit

Citrix ShareFile

Files.com

WinSCP

With these FTP clients, we can easily move files between local and remote file systems.

SSH can greatly benefit all your cloud computing endeavors. Here you get more advanced functionality that can make your work easier. It is a lightweight, secure and easy way to connect to a remote server.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message