Home > Operation and Maintenance > CentOS > Ordinary users of centos system cannot log in to ssh

Ordinary users of centos system cannot log in to ssh

王林
Release: 2020-03-19 14:44:33
Original
4446 people have browsed it

Ordinary users of centos system cannot log in to ssh

In CentOS, if everything goes well, if you create a new user, it will be automatically added to the SSHD login service. There is no need to manually or set anything, but there are some In this case, our system only allows the root user to log in, then we need to make some necessary settings. The specific steps are as follows:

1. When you log in, please make sure that the user name you entered and For the correctness of the password, it is best to see the user name in /home/ and its related folders. If you are creating a new user without a home, you must also check whether the relevant user name and other information already exist in the /etc/passwd file. content.

(Recommended tutorial: centos usage tutorial)

2. Check the #vim /etc/ssh/sshd_config file and you will find that the UsePam certification has been opened.

Solution:

3. Modify "-:ALL EXCEPT root :ALL" in #vim /etc/security/access.conf to "-:ALL EXCEPT root yourusername :ALL" .

4. Restart the sshd service.

Note: If you modify this configuration through remote login, the "root" user in the above cannot be removed. Otherwise, if any abnormality occurs, you will have to find another way to log in again. If After this configuration modification is successful, you can remove the login authentication of the root user.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of Ordinary users of centos system cannot log in to ssh. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template