Use an alias and key to log in on centos:
vim /root/.ssh/config #Enter the following content
Host *
User root #Log in as root
ServerAliveInterval 60 #Survival time
#test1
Host q0 #Login alias
HostName 10.10.10.1 #ip address
User root
Port 22
IdentityFile ~/.ssh/skey_web #Path of private key
#web1
Host q1
HostName 10.10.10.1
User root
Port 22
IdentityFile ~/.ssh/ skey_web
Transfer the private key to the path defined above to modify permissions:
chmod 600 ~/.ssh/skey_web
Required Want to change. Only the owner can read and write
Then restart ssh and try to log in:
ssh q1
The above is the detailed content of SSH alias login key login instance tutorial. For more information, please follow other related articles on the PHP Chinese website!
Statement: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