July 9, 2020

Remote server-Features

remote services

SSH Config File

remote server

If You’re connecting to multiple remote server over SSH on A daily basis, you might discover that remembering all the remote IP addresses, different usernames, non-standard ports, and various command-line options is difficult, maybe impossible.

The OpenSSH client reads the options set from the per-user Configuration file (~/.ssh/ / config). For every remote machine you link, you can store SSH choices that are different Inside this file to.

A sample SSH config is shown below:

Host dev

HostName dev.linuxize.com

User mike

Port 4422

Duplicate

By typing the control is deved by ssh, After you invoke the ssh client Will read the ~/.ssh/config file and use. In this example, ssh dev is equal to these:

Ssh -p 4422 mike@dev.linuxize.com

To learn more, check the article on SSH config file.

Public Key Authentication

The SSH protocol supports various authentication mechanisms.

The authentication mechanism lets you Log into the remote server without needing to type your password.

This technique works by generating a set of keys Which are used for authentication. The private key is saved on the client device, along with the public key is transferred to each remote server that you would like to log in. The machine must be configured to take authentication.

If you don’t have SSH key pair on your machine

ssh-keygen -t rsa -b 4096 -C

You’ll be asked to type a secure passphrase. Whether you Wish to use passphrase it is up to you.

Once you have your key pair, copy the public key to the remote server:

ssh-copy-id username@hostname

Enter the remote user password, and the key will be Appended to the user authorized_keys file.

Once the secret is uploaded, you can log in to the remote Server without being prompted for a password.

By placing a key-based authentication, you are able to simplify the Login procedure and increase the server security.

Port Forwarding

SSH tunneling or SSH port forwarding is a method of generating An SSH link between a client and a server machine through uninstalled.

SSH forwarding is useful for transporting network data of Services which use an unencrypted protocol, such as VNC or FTP, bypassing intermediate or obtaining articles that is geo-restricted firewalls. Basically, you can TCP port and tunnel the traffic over a secure SSH connection.

Local Port Forwarding

Local port forwarding allows you From the client host then and to the SSH server host to the destination server port.

To make a local port forwarding pass the -L option to the ssh client:

ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION_HOST:DESTINATION_PORT -N -f username@hostname

And -N not to execute a remote command.

Remote Port Forwarding

Remote port forwarding is the reverse of local port forwarding. It forwards a port from the server host then and to the client host to the destination server interface.

The -L option tells ssh to create a distant port forwarding:

ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT -N

Dynamic Port Forwarding

Conclusion

To connect to a remote server via SSH use the ssh command Followed by the remote username and hostname (ssh username@hostname).

Managing remote server.