Linux SSH connection settings

Source: Internet
Author: User

suselinux11 SSH settings. Close the root user connection, using the sshd user connection. The root user is then redirected through the sshd user.

1. Set/etc/ssh/sshd_config

#vi/etc/ssh/sshd_config

Port 22 (using 22 ports)

Clientaliveinterval 300 (logs a timeout after connecting 300s)
Clientalivecountmax 0 (if the client is found to be not corresponding, then a timeout is determined, this parameter sets the number of times the timeout is allowed)

Allowusers sshd (only sshd users log on after server hardening)

2. Adding sshd to a user group

(1)/etc/pam.d/su file see if the following sentence is set to work.
Auth Required pam_whell.so Use_uid

(2) Note su_wheel_only Yes

Vi/etc/login.defs
#SU_WHEEL_ONLY Yes

(3)/BIN/SU's permission is '-rwsr-xr-x '

Ll/bin/su

-rwsr-xr-x 1 root root 40016 Mar 2013/bin/su

3. Su-root password is correct, error su:incorrect password

(1) Because/etc/pam.d/su in auth required pam_whell.so Use_uid

(2) Need to add sshd user to Whell Group

#usermod sshd-g Whell

4. Turn off the firewall

(1) Temporarily shut down the firewall

Rcsusefirewall2_setup stop

Rcsusefirewall2_init stop

(2) Permanently shut down the firewall

Chkconfig Susefirewall2_setup off

Chkconfig Susefirewall2_init off

5., Start SSH

/etc/init.d/sshd start

Chkconfig sshd on (SSH join auto-start)

Linux SSH connection settings

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.