by Devin Yang
(This article was automatically translated.)

Published - 3 years ago ( Updated - 3 years ago )

Document how I restart sshd service on MacOS.
#ssh into the remote MAC, the execution will not be disconnected, and it can be executed separately. When unloading, you cannot log out, otherwise you will not be able to connect again.
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist

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

#You can handle unload and load in one line
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist&&sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

Tags: MacOS

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


Emoji, MacOS

⌘+control+blank (Emoji on Mac)

⌘+control+blank (Emoji on Mac)

vpn,cli,macos

How do I dial a VPN from the command line on MacOS

I myself will need to use MacOS to dial VPN in the command line. Here I provide my alias and setting method

MacOS

How to disable IPV6 functionality on a specific device in MacOS

How to disable or enable IPV6 on your own MacOS, you can use networksetup -listallnetworkservices to list all MacOS network devices, and then execute the disable command.