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

相关文章:

  • 2021-12-29
  • 2021-04-30
  • 2021-11-10
  • 2021-05-20
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2021-05-07
  • 2021-07-09
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案