How to implement linux ssh alias login

07-26-2023

This article introduces the knowledge about how to realize Linux ssh alias login. During the operation of the actual case, many people will encounter such a dilemma. Next, let the editor guide you to learn how to deal with these situations Bar! I hope you read it carefully and learn something!

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:

p>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< br/>pubkeyauthentication

This is the end of the introduction of how to implement linux ssh alias login, thank you for reading. If you want to know more industry-related knowledge, you can pay attention to the Yisuyun website, and the editor will output more high-quality practical articles for you!

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