Sometimes we need to create a user-defined account. Generally, the newly created account can log on to the server using the ssh tool. to improve security, we must disable the SSH login permission for this account. 1. create an account and directly disable logon to useraddkwxgd-s/sbin/nologinSSH to execute the preceding commands. create a new account named kwxgd and grant the login prohibited permission. II. set password p
Sometimes we need to create a user-defined account. Generally, the newly created account can log on to the server using the ssh tool. to improve security, we must disable the SSH login permission for this account.
1. create an account and directly disable logon
useradd kwxgd -s /sbin/nologin
Run the preceding commands in SSH to create an account named kwxgd and grant the login prohibited permission.
2. set the password
passwd kwxgd
Run the preceding command in SSH to add the password for "kwxgd.
3. what should I do if I forget to set permissions if I have added an account?
1. edit a file
vi /etc/passwd
2. find the corresponding user name and modify the login configuration
The default write parameters are:/bin/bash, which can be changed to/sbin/nologin in format.
After modification and save, it will be OK.