Linux 124 Course 9, Configuration and security OpenSSH services

Source: Internet
Author: User
Tags asymmetric encryption

SSH Remote Login tool based on RSA algorithm
RSA Asymmetric Encryption algorithm:
Public Key: External public
Private key: Private storage
  
The private key can be opened with the public key, and the public key can be opened with the private key;
Data encryption method, the other party's public key to encrypt data, and then passed to the other side, the other's private key can be solved.

OpenSSH refers to the software implementation of the Secure Shell software system. SSH is used to securely run on a remote system shell.
If you have a remote Linux system that provides a user account for the SSH service, SSH is usually used for Telnet, system commands. The SSH command can also be used to run a separate command on the remote system.

1. Log on to the remote system using SSH to run the command prompt (password-based SSH)
Ssh-x (optional Remote Desktop) root (user name) @172.25.0.11 (IP address or host name)
SSH [email protected] Yes

Transfer the public key of the remote system to accept the public key for encryption. Unlock with the private key of the remote system
Cd/etc/ssh/ssh_host_ecdsa_key Private Key storage location

W.H.O.
W-f

2, configure the key-based SSH login
Su-student using a regular account to do remote login
First step: Generate public and private keys Ssh-keygen/home/student/.ssh/id_rsa.pub

Step Two: Transfer the public key to the service side
Ssh-copy-id 172.25.0.11

Step three: Do the test

3, custom SSH configuration limit direct login, such as root or password-based authentication
SSH configuration file Location/etc/.ssh/sshd_config

Port SSH default Listener TCP 22nd ports
ListenAddress 0.0.0.0 listens to all local addresses by default
Permitroorlogin Yes by default allows the root user to SSH in
Passwordemptypassword No does not allow null password login
Passwordautheticationn No password authentication is not used

The port number suggests that you change
Port 2222 Port number modified to 2222, but still inaccessible

Firewall off, turn off SELinux
Systemctl Stop Firewalld.service Firewall off
Setenforce 0 temporarily close SELinux
Getenfoce Permissive View selinux status

Ssh-p 2222 [email protected] After changing port, connection mode

After modifying the configuration file, restart the configuration file
Do not allow users to log on remotely with root privileges

Linux 124 Course 9, Configuration and security OpenSSH services

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.