为了方便登录服务器,我们一般使用putty、securecrt等等工具。在终端如何通过服务器别名来进行登录呢?
可以创建~/.ssh/config 文件并为每台服务器指定登录信息和验证方法,如下所示:
$ 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
然后直接指定别名进行登录
shell
$ ssh www
1 $ ssh www
选项注释:
hostname 指定登录的主机名或ip地址
port 指定登录的端口号
user 登录用户名
identityfile 登录的公钥文件
identitiesonly 只接受ssh key 登录
pubkeyauthentication
以上就是linux ssh别名登录的方法是什么的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号