Linux installation ssh and SSH usage with password-free login

Source: Internet
Author: User

First, configure Yum

Second, what is SSH

    • The administrator can manage the multiple hosts scattered across the network by remote login.
    • Administrators can do the following for remote hosts:
      • Remote Login
      • remote command execution
      • Remote File transfer
    • The sad thing is: these operations are unsafe!
    • Use plaintext passwords and send them in clear text
      • Information may be intercepted and passwords may be retrieved
      • Unauthorized personnel using the intercepted password to log on to the system, causing damage to the system

SSH 's Goal

    • Provide secure network services on unsecured networks.

Third, installation command

  

Yum install-y openssh-server openssh-clients

To start SSH:

Service sshd start or/etc/init.d/sshd start

To configure boot boot:

Chkconfig--level 2345 sshd on

Four, ssh password-free login

Ssh-keygen's command manual, through the "Man Ssh-keygen" command:

1. Generate Secret Keys

SSH-KEYGEN-T RSA

  

A ". SSH" folder will be generated at the user's root directory after the build

  

Entering ". SSH" will generate the following files

  

Authorized_keys: The public key that stores the remote password-free login, which records the public key of multiple machines mainly through this file.

ID_RSA: Generated private key file

Id_rsa.pub: Generated Public key file

Know_hosts: List of known host public keys

If you want the SSH public key to take effect, at least two of the following conditions will be met:

1). The SSH directory must have permissions of 700

2). The. ssh/authorized_keys file permission must be 600

2. Password-Free login method

2.1 By way of Ssh-copy-id

Command: Ssh-copy-id-i ~/.ssh/id_rsa.put [ip/hosts]

    

    

2.2 Writing content to each other's files via SCP

Command: scp-p ~/.ssh/id_rsa.pub [Email Protected]<remote_ip>:/root/.ssh/authorized_keys

    

V. Usage of SSH

1.SSH Login to another Linux

SSH [ip/hosts]

  

Sign Out:

Exit

2. Copying files

Grammar:

SCP the file name (relative or absolute path) to be copied to the ip:/path of the machine to be copied to

3. Copying folders

Grammar:

Scp–r folder [email protected]/hosts:/path

  

  

Linux installation ssh and SSH usage with password-free login

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.