代码改变世界

SecureCRT 添加Mac Localhost

2018-02-02 13:37  鸣仁  阅读(1364)  评论(0编辑  收藏  举报

 1.启动sshd服务:

sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

停止sshd服务的方法:

sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

2.查看是否启动:

sudo launchctl list | grep ssh

下面的输出表示成功启动了:
--------------
- 0 com.openssh.sshd

3. 连接mac电脑

    ssh localhost 

    或者

    ssh name@127.0.0.1 -p22  (22是ssh的默认端口)

4.登录后中文乱码的解决方法:
(4.1),secureCRT连接设置编码为UTF-8编码
(4.2),在/etc/profile最后加入 export LANG=zh_CN.UTF-8
(4.3),修改/etc/profile 提示文件只读。 sudo chmod +w /etc/profile
(4.4),执行 source /etc/profile