Modify SSH ports and disable root remote login settings in Linux

Source: Internet
Author: User

Modify SSH ports and disable root remote login settings in Linux


  1. View the system version below

    [Email protected] ~]# cat/etc/redhat-release

    CentOS Release 6.7 (Final)

  2. Modifying a configuration file

    Linux Modify Port
    vim /etc/ssh/sshd_config
    Find #port
    Remove the previous # and then modify port 1234
    650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9B/AE/wKiom1ll2nOBTfZVAAANOYt0oEw047.png "title=" 11. PNG "alt=" Wkiom1ll2nobtfzvaaanoyt0oew047.png "/>
    Restart The service is OK
    service sshd restart
    or
    /etc/init.d/ssh restart
    to enhance security
    first add a user with normal permissions and set the password
    useradd test
    passwd test
    then disable root remote SSH login:
    vim /etc/ssh/sshd_config
    put one of the
    PermitRootLogin yes
    instead
    PermitRootLogin no650) this.width=650;" src="https://s3.51cto.com/wyfs02/M00/9B/AE/wKioL1ll2tSh-vgqAAALAx9ISbc476.png" title="11.PNG" alt="wKioL1ll2tSh-vgqAAALAx9ISbc476.png" />
    Restarting the sshd service
    service sshd restart
    or
    /etc/init.d/ssh restart
    remote management with ordinary user test login, and then use SU root to switch to the root user can get the highest privileges!


This article is from the "Hand of the Paladin Control" blog, please make sure to keep this source http://wutengfei.blog.51cto.com/10942117/1946764

Modify SSH ports and disable root remote login settings in Linux

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.