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


cli,linux,macos

How to use find to delete old files based on the creation time

This function is very useful, but be very careful, read it first and then delete it, if you make a wrong directory, you will die miserably 

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.