Skip to content

Instantly share code, notes, and snippets.

@Junch
Forked from influx6/restart-ssh.bash
Created September 28, 2021 07:18
Show Gist options
  • Select an option

  • Save Junch/c30bb495d1a9f79e678446cacb939a30 to your computer and use it in GitHub Desktop.

Select an option

Save Junch/c30bb495d1a9f79e678446cacb939a30 to your computer and use it in GitHub Desktop.
Restart SSH on Mac Terminal (High Sierra)
sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd
@Junch
Copy link
Author

Junch commented Sep 28, 2021

服务端SSH 服务配置了禁止root用户登录策略。

通过 cat 等指令查看 /etc/ssh/sshd_config 中是否包含类似如下配置:
PermitRootLogin no

https://cloud.tencent.com/developer/article/1454777

@Junch
Copy link
Author

Junch commented Sep 28, 2021

Get the ip address of the mac computer

ifconfig -l | xargs -n1 ipconfig getifaddr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment