Install OpenSSH servercentos in centos 6.2 to set Automatic startup of services

Source: Internet
Author: User
Tags openssh server ssh server
ArticleDirectory
    • Install OpenSSH server
    • Log on to the remote server using a password
    • Log on to the remote server with the RSA key
    • OpenSSH related directories and files
    • OpenSSH links

After centos 6.2 is installed, I want to use centos as a server to remotely log on to my Windows 7 computer.

 

Install OpenSSH server

First, search for any defined SSH server package in the centos software library:

$ Yum searchSSH
......OpenSSH. x86_64: an open source implementation of SSH protocol versions1And2OpenSSH-Askpass. x86_64: a passphraseDialog ForOpenSSH and xopenssh-Clients. x86_64: an open source SSH client applicationsopenssh-LDAP. x86_64: a ldap supportForOpen source SSH server daemonopenssh-Server. x86_64: an open source SSH server daemon
......

 

OpenSSH is an open-source Implementation of Secure Shell. From the above search results, we can see that the centos software library contains the OpenSSH server package (openssh-server) and client package (openssh-clients), which can be directly installed using Yum install.

$ YumInstallOpenssh-Server

 

After the OpenSSH server is installed, a service named sshd should be added to the/etc/init. d directory. You can configure the sshd service to automatically start when it is started by referring to centos Setting Automatic startup of services.

 
$ Chkconfig --List sshdsshd0: Off1: Off2: On3: On4: On5: On6: Off

 

Manually start the sshd service to facilitate subsequent client connection:

 
$/Etc/init. d/sshd start

 

Log on to the remote server using a password

I use xshell for the SSH client software in Windows 7. Open xshell, create a connection, select password authentication, and enter the user name and password to connect to the server.

 

Screen after Successful Logon:

 

Log on to the remote server with the RSA key

OpenSSH allows you to use RSA to log on to the server. The RSA encryption method has two files: one is the public key file, which is placed in the $ home/. Ssh/authorized_keys file of the server; the other is the private key file, which is placed on the client computer.

 

An RSA key pair can be generated on the server or on the client:

 
$Ssh-keygen

After the execution is complete, two files are added in the $ home/. Ssh Directory: id_rsa.pub (Public Key File) and id_rsa (private key file ).

 

Append the public key file to the end of the $ home/. Ssh/authorized_keys file:

 
$CatId_rsa.pub> authorized_keys

 

Download the private key file to the Client Computer (you can use the SFTP method, such as xftp, winscp, and many other software), create an xshell connection, and select the public key authentication method:

 

After the configuration is complete, we can connect to the server without entering a password.

 

OpenSSH related directories and files

Directory for saving all configuration information:/etc/ssh

Sshd service configuration file:/etc/ssh/sshd_config

 

OpenSSH links

Use OpenSSH to build an SSH server: install an O-pot SSH server.

Log on to the server with SSH client software: How to log on to the remote server with putty + RSA.

Centos wiki-OpenSSH protection: OpenSSH security settings.

Top 20 OpenSSH server best security practices: 20 SSH Security suggestions to be followed.

Related Article

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.