Reasons why Linux ordinary users cannot connect remotely

Source: Internet
Author: User

Operating system: CentOS6.5

Remote Connection tool: SecureCRTV7.0

Production Environment Combat tasks: Disable remote "root" account connection, remote connection via normal "Sky" account, and modify the default remote port number "22".

Operation Steps:

1. Create a regular user:

[Email protected]~]# useradd Sky

[Email protected]~]# passwd Sky

2. Modify the configuration file: Sshd_config

[[Email protected]~]# vi/etc/ssh/sshd_config

#Port22 #去掉该行的注释 and modify the port number that you need

#PermitRootLogin Yes #修改成PermitRootLogin no

#修改之后进行保存, there are several points to note:

a "       [[email protected] ~] #iptables  -A  input-p tcp-m State--statenew-m tcp--dport 9899 -j  ac cept  # Allow port number through firewall

b "       [[email protected] ~]#/etc/init.d/iptables save  # Save to file, always in effect

c "       [[email protected] ~]#/etc/init.d/iptables restart  # restart effective

d "       [[email protected] ~]# service  sshd  restart    # restart effective

    To this step, all operations completed, not only "root" The account cannot be connected remotely, and the ordinary account "Sky" also cannot connect remotely. This is not the effect we want, what is the reason?

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/55/wKiom1TQUPmQyqHIAAMccJDVCLQ556.jpg "style=" Float:left; "Title=" is not named. JPG "alt=" wkiom1tqupmqyqhiaamccjdvclq556.jpg "/>

3. The error appears as follows:

Theserver have disconnected with an error. Server message reads:

Aprotocol error occurred. Change of username or service not allowed: (root,ssh-connection)-(sky,ssh-connection)

with repeated verification, the problem arises on the SECURECRT setting, There are two things to do in this dialog box:

A) change the default port number "22" to "9899"

b) change the user name "root" to "sky" or blank

c) if the default user name is modified to "sky" in the connection dialog, the default user name is also considered.

Finally, you can connect remotely with a regular account:

Last Login:tue Feb 3 12:17:13 from 117.40.239.12

[[Email protected]~]$


This article is from the "Linux~dba~mba" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1611065

Reasons why Linux ordinary users cannot connect remotely

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.