今天总算是见识到了mac作为程序员友好型电脑的强大之处。使用自带的ssh登陆腾讯云服务器。
命令行界面登录ssh
1、使用命令行查看安装地址
(base) dghcs:~ tudghian$ whereis ssh
/usr/bin/ssh
2、查看当前电脑的ssh行程
(base) dghcs:~ tudghian$ ps aux | grep ssh
tudghian 20518 1.5 0.0 4278296 840 s000 S+ 3:36下午 0:00.01 grep ssh
可以看出并没有ssh进程,因为没有打开mac的远程登录功能
打开系统偏好设置
打开共享
勾选左边两个选项
3、使用命令ssh localhost查看
(base) dghcs:~ tudghian$ ssh localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is SHA256:PIZ12342cRa3cA7uV4M88abHzqKI.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Password:
Last login: Fri Jan 10 15:33:00 2020
(base) dghcs:~ tudghian$ ps aux | grep ssh
tudghian 20575 0.0 0.0 4268056 808 s001 S+ 3:39下午 0:00.00 grep ssh
tudghian 20556 0.0 0.0 4318052 1428 ?? S 3:39下午 0:00.01 sshd: tudghian@ttys001
tudghian 20554 0.0 0.1 4283224 5224 ?? S 3:38下午 0:00.03 /usr/bin/ssh-agent -l
root 20548 0.0 0.1 4318120 7480 ?? Ss 3:38下午 0:00.08 sshd: tudghian [priv]
tudghian 20547 0.0 0.1 4335420 6416 s000 S+ 3:38下午 0:00.07 ssh localhost
4、使用命令登陆服务器输入密码登陆!!!大告成功
(base) dghcs:~ tudghian$ ssh -p 22 root@11.279.1250.73
The authenticity of host '11.729.1250.73 (111.729.1570.73)' can't be established.
ECDSA key fingerprint is SHA256:trOsjFE6rGwEv8Mk/XZnP358k5yAdzhLIMlydu3PVag.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '111.229.150.73' (ECDSA) to the list of known hosts.
root@111.229.150.73's password:
Last login: Fri Jan 10 15:06:34 2020 from 119.29.96.147
图形界面ssh登陆
1、打开终端,点击shell
2、新建远程连接
3、新建+一个IP地址
点击连接
输入密码
登陆成功
来源:CSDN
作者:戎码关山
链接:https://blog.csdn.net/dghcs18/article/details/103925769