Remote Mac logon Using SSH

Source: Internet
Author: User

1. Open SSH

Mac terminal comes with SSH. You can use whereis to see it:

$ whereis ssh

However, the SSH process cannot be found in the existing process:

$ ps aux | grep sshapple           25927   0.0  0.0  2432784    616 s000  R+    3:14下午   0:00.00 grep ssh


When you directly connect to a local host or remote host using SSH commands, the following error message is displayed:

ssh: connect to host localhost port 22: Connection refused


Google opened the remote logon because it was not enabled in the system settings. For details, see: How do I open port 22 in OSX 10.6.7.

Solution:

Open System preference settings-share and select remote Logon:



Enter SSH localhost for testing. If you are prompted to enter the password for authentication, it will be okay.

Now let's look at the grep process and we can see that the SSH process is running:

$ ps aux | grep sshapple            4656   0.0  0.0  2525056   1540   ??  S    三02下午   0:00.19 /usr/bin/ssh-agent -lapple           26009   0.0  0.0  2432784    612 s000  R+    3:19下午   0:00.00 grep ssh


Ii. SSH and SCP

Next, you can use the SSH command to connect to other hosts, for example:

SSH [email protected]

Username is the username of the host to be logged on, and 192.168.100.100 is the IP address of the host to be logged on.

To view the number of logged-on users, run the who command.


The SCP command transfers files between the local host and the remote host. The simple usage is as follows:

$ scp .zshrc [email protected]:/Users/username/


This command copies the. zshrc file in the current path to the/users/username directory of the remote host.

This saves the trouble of resetting zshrc.

Reference: How to Use the CP and SCP commands in Linux


If the input [email protected] is incorrect, shell will not prompt any. Only by entering the correct address will we be asked to enter command authentication for the next step.



Remote Mac logon Using SSH

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.