What is the method to log in with linux ssh alias?

王林
Release: 2023-05-15 20:52:12
forward
1401 people have browsed it

In order to facilitate login to the server, we generally use tools such as putty, securecrt and so on. How to log in through the server alias in the terminal?

You can create the ~/.ssh/config file and specify the login information and verification method for each server, as shown below:

$ vim ~/.ssh/config

host www
  hostname www.ttlsa.com
  port 22
  user root
  identityfile ~/.ssh/id_rsa.pub
  identitiesonly yes

host bbs
  hostname 115.28.45.104
  user anotheruser
  pubkeyauthentication no
Copy after login

Then directly specify the alias to log in

shell
$ ssh www
1 $ ssh www
Option comments:

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

The above is the detailed content of What is the method to log in with linux ssh alias?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template