Prohibit root users from accessing through SSH remote logon and restrict some users from logging on remotely.
Source: Internet
Author: User
Prohibit root users from accessing through SSH remote logon and restrict some users from remote logon-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. Prohibit ROOT users from accessing through SSH remotely.
Modify the/etc/ssh/sshd_config file. Find the following sentence:
# PermitRootLogin
Yes
As follows;
PermitRootLogin
No
Note: remove the # above.
Restart sshd server
[Root @ linuxsir001 root] # service
Sshd restart
2. Restrict Remote logon for some users
This account is currently not available.
Sometimes users in the same group can log on, some cannot log on remotely, and vipw can be used to view account information (/etc/passwd ), if the account information shell is/sbin/nologin, remote logon is prohibited. If you want to allow remote logon, change it to a shell that can be logged on, such as/bin/bash.
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.