Pages

Friday, June 2, 2017

How to Configure Custom SSH Connections to Simplify Remote Access

SSH (SSH client) is a program for remotely accessing a machine, it enables a user to execute commands on a remote host. It is one of the most recommended method for logging in to a remote host, since it is designed to provide secure encrypted communications between two untrusted hosts over an insecure network.
SSH uses both a system-wide as well as a user-specific (custom) configuration file. In this tutorial, we will explain how to create a custom ssh configuration file and use certain options to connect to remote hosts.

Requirements:

  1. You must have installed OpenSSH client on your Linux desktop.
  2. Understand the common options used for remote connections via ssh.

SSH Client Config Files

Below are the locations of the ssh client configuration files:
  1. /etc/ssh/ssh_config – this is the default, system-wide configuration file. It contains settings that apply to all users of ssh client machine.
  2. ~/.ssh/config or $HOME/.ssh/config – is the user-specific/custom configuration file. It has configurations that apply to a specific user. It therefore overrides default settings in the system-wide config file. This is the file we will create and use.
By default, users are authenticated in ssh using passwords, however, you can setup ssh passwordless login using ssh keygen in 5 simple steps.
Note: In case the directory ~/.ssh does not exist on your desktop system, create it with the following permissions.
$ mkdir -p ~/.ssh
$ chmod 0700 ~/.ssh   
The chmod command above implies that only the user can have read, write and execute permissions on the directory as required by ssh settings.

How To Create User Specific SSH Configuration File

This file is usually not created by default, so you need to create it with the read/write permissions for only the user.
$ touch ~/.ssh/config
$ chmod 0700 ~/.ssh/config
The above file contains sections defined by hosts specifications, and a section is only applied to hosts that match one of the patterns set in the specification.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n5Z91
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment