Mac how to turn SSH on/off via terminal

Source: Internet
Author: User
Tags ssh ssh server

newer Mac devices will have SSH installed by default, but the SSH daemon is disabled by default.

SSH (Secure Shell) is a versatile, powerful, software-based network security solution. Each time the computer sends data to the network, it is automatically encrypted by SSH. Newer MAC devices running OS X, or MacOS, will have SSH installed by default, but the SSH daemon is disabled by default. Today we'll come together to learn how to turn SSH on and off using terminal instructions.

See if SSH telnet is turned on via terminal

Want to see the current state of SSH on your Mac? Use a simple terminal to check whether SSH and Telnet are currently open:

sudo systemsetup-getremotelogin

If it is already open, the command will display "remote Login:on", whereas the "remote Login:off" will be displayed.

Turn on Mac SSH via terminal command

To quickly open the SSH server and allow the SSH connection to enter the current MAC, use the following instructions:

sudo systemsetup-setremotelogin on

After you enter the directive, there is no confirmation that Telnet and SSH are turned on, but you can use the method mentioned above to check for success.

Turn off the Mac SSH via terminal command

If you want to disable the SSH server through terminal instructions and block remote connections, enter the following instructions:

sudo systemsetup-setremotelogin off

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.