What is the method of linux ssh alias login

02-15-2023

The editor in this article will introduce in detail the method of linux ssh alias login for you. The idea of editing is slowly deepening, let's learn new knowledge together.

In order to facilitate the login server, we generally use putty, securecrt and other tools. How to log in through the server alias at the terminal?

You can create a ~/.ssh/config file and specify login information and authentication methods for each server, as follows:

$ vim ~/.ssh/config host www hostname www.ttlsa.com port 22 user root identityfile ~/.ssh/id_rsa.pub identities only yes host bbs hostname 115.28.45.104 user anotheruser pubkeyauthentication no

Then directly specify an alias to log in

shell
$ ssh www
1 $ ssh www
Option Note:

hostname specifies the login host name or ip address
port specifies the login port number
user login user name
identityfile the public key file for login
identitiesonly only accepts ssh key login pubkeyauthentication


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us