Weblog entry #7 for pedxing
#7
Securing a Folder
Posted by pedxing on Wed 29 Jun 2005 at 19:39
As a response to simonw's question.
First step is to create the folder that you want to restrict access to. In our example it will be /usr/downloads
`mkdir /usr/downloads`
Next, we will create a group to grant permissions to the folder. I will call the group lusers (for local users, of course)
`addgroup lusers`
We set the ownership of the folder to root user and lusers group.
`chown root:lusers /usr/downloads`
And set the permissions so that no non-lusers have access, and lusers have full access.
`chmod 770 /usr/downloads`
Next we add access for the people who are authorized. This is best done by editing the file /etc/group file using the `vigr` command. Locate the line that looks like:
"lusers:x:1019:"
The number will be different according to your system setup. To add the users "jay" and "pedxing" to the group, change the line to:
"lusers:x:1019:jay,pedxing"
Save and quit (vigr uses vi commands).
The users will have access to /usr/downloads next time they log in. They will have to log out/in if they are already in while the changes are made.
Comments
First step is to create the folder that you want to restrict access to. In our example it will be /usr/downloads
`mkdir /usr/downloads`
Next, we will create a group to grant permissions to the folder. I will call the group lusers (for local users, of course)
`addgroup lusers`
We set the ownership of the folder to root user and lusers group.
`chown root:lusers /usr/downloads`
And set the permissions so that no non-lusers have access, and lusers have full access.
`chmod 770 /usr/downloads`
Next we add access for the people who are authorized. This is best done by editing the file /etc/group file using the `vigr` command. Locate the line that looks like:
"lusers:x:1019:"
The number will be different according to your system setup. To add the users "jay" and "pedxing" to the group, change the line to:
"lusers:x:1019:jay,pedxing"
Save and quit (vigr uses vi commands).
The users will have access to /usr/downloads next time they log in. They will have to log out/in if they are already in while the changes are made.
Comments
[ 0 Comments
|
]
| <<< Previous | Next >>> |