Mac password-Free login server

Source: Internet
Author: User
Tags free ssh

Since Mac OS is very similar to UNIX-based operating system terminals and Linux, it is not possible to remotely log on to a Linux server without the use of Windows-like putty and CRT tools, requiring a simple 3-step password-free SSH remote.

1: Generate the key. Under Mac Terminal, execute the following command:
SSH-KEYGEN-T RSA
The default is to press ENTER on the line, do not have to make other changes, after execution will generate two files, a public key, a private key.
LS ~/.ssh
#id_rsa (private key) id_rsa.pub (public key)

2: Place the public key to the server that needs to be remote.
SCP ~/.ssh/id_rsa.pub User @:/home/user/.ssh/, or can be copied to/root/.ssh

3: Log on to the remote server
CD ~/.ssh
CAT/user root/.ssh/id_rsa.pub >> authorized_keys #将公钥内容加入到authorized_keys文件, no, just create one.

In addition to using the Mac OSX Terminal SSH command to connect to the server, if a period of inactivity, you will be logged out and the following error message appears:

Write Failed:broken Pipe

The SSH command can only be used to connect again.

Workaround

Method One: $ ssh-o serveraliveinterval=60 [email protected]

Method Two: Simply add the following configuration to the server's/etc/ssh/sshd_config:

Add or modify Clientaliveinterval to "Clientaliveinterval 60". This parameter means that every 1 minutes, the server sends a message to the client to keep the connection. Remember to restart the SSH service after saving.

Mac password-Free login server

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.