1 Create a user and specify the user's root path and password useradd -d /home/mydir -m username Users created in this way can log in using ssh, but have only read-only permissions to browse and download some files but cannot write or modify them. It is recommended to obtain permissions for the specified path by adding the user to a group. 2 Set a password 3 User Authorization chown -R username: username /home/ mydir chmod 755 /home/mydir 4 Add users to the group Add a user to a user group. Try not to use it directly (unless it really belongs to only one group): Doing this will remove you from the other groups and make you a member of groupA only. Should be used with -a option: To view the groups to which a user belongs, use the command Summarize The above is what I introduced to you about creating a new user in Linux and granting relevant permissions to the specified directory. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Complete steps to install MySQL 8.0.x on Linux
>>: DOM operation implementation in react
Table of contents 1. Achieve results 2. Implement...
This article shares the specific code for JavaScr...
1: Understand the meaning of address rewriting an...
Table of contents 1. What is Function Anti-shake?...
Unicode is a character encoding scheme developed ...
Display Definition ID When the auto-increment ID ...
There are many differences between IE6 and IE7 in ...
Recently, new projects have used springcloud and ...
First check the kernel version you are using lin@...
Table of contents Tutorial Series 1. MySQL Archit...
question First, let me talk about the problem I e...
use Flexible boxes play a vital role in front-end...
<br />Tips for making web table frames. ----...
1. Go to the GraphVis official website to downloa...
Create your first web page in one minute: Let'...