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


macos

About ditto instructions on MacOS

The ditto command appeared in Mac OS X (10.0) for the first time. In some cases, it is more intuitive than the cp command. Those who are interested can study and test it by themselves. Assuming that there is an envs folder in my directory, my test is as follows:

MacOS

How do I compile tree instructions on MacOS?

I believe that Linux users have probably used the tree command. We can directly install the tree command through homebrew. But if we want to compile and install by ourselves, how should we do it? This article introduces how to compile tree instructions and install on your own MacOS.  

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