CentOS server side configuration SSH Remote Connection tutorial

Time:2020-10-13

With CentOS 6.4 installed, I want it to act as a server that allows my windows 7 computer to log in remotely.

Install openssh server
First, let’s search the CentOS software library for defined ssh server packages:

Copy code

The code is as follows:

$ yum search ssh
… …
openssh.x86_64 : An open source implementation of SSH protocol versions 1 and 2
openssh-askpass.x86_64 : A passphrase dialog for OpenSSH and X
openssh-clients.x86_64 : An open source SSH client applications
openssh-ldap.x86_64 : A LDAP support for open source SSH server daemon
openssh-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 there are openssh server and openssh clients in CentOS software library, which can be installed directly by using Yum install.

Copy code

The code is as follows:

$ yum install openssh-server

After the openssh server is installed, a service named sshd should be added in the / etc / init. D directory.

Copy code

The code is as follows:

$ chkconfig –list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Manually start the sshd service to facilitate the connection of the following clients:
close:

Copy code

The code is as follows:

/etc/init.d/sshd stop

Start up:

Copy code

The code is as follows:

/etc/init.d/sshd start

Restart:

Copy code

The code is as follows:

/etc/init.d/sshd restart

function
1. Take effect after restart
Open:

Copy code

The code is as follows:

chkconfig sshd on

close:

Copy code

The code is as follows:

chkconfig sshd off

2. Immediate effect, invalid after restart
Open:

Copy code

The code is as follows:

service sshd start

close:

Copy code

The code is as follows:

service sshd stop

Solution of Chinese garbled code in PS: CentOS SSH connection
In CentOS 6, when SSH, the Chinese garbled code will be displayed, then:

Modify / etc / sysconfig / I18N file

Command:

Copy code

The code is as follows:

vi /etc/sysconfig/i18n

Finally, the text inside will be modified as follows:

Copy code

The code is as follows:

LANG=”zh_CN.GB18030″
LANGUAGE=”zh_CN.GB18030:zh_CN.GB2312:zh_CN”
SUPPORTED=”zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en”
SYSFONT=”lat0-sun16″

Finally, disconnect and re connect SSH. Enter the date command to view the effect

Recommended Today

Using ckeditor and dotnetcore to upload pictures

This example for you to share the ckeditor and dotnetcore image upload specific code, for your reference, the specific content is as follows Using ckeditor 1. Introduce JS library <script src=”https://cdn.ckeditor.com/4.6.1/standard-all/ckeditor.js”></script> 2. Define a textarea label <textarea> </textarea> 3. Replace textarea with ckeditor to use basic functions CKEDITOR.replace(‘editor’); 4. Configure ckeditor Add image upload, code […]