PDA

View Full Version : [SOLVED] How I can say: "this particular user should not be able to access a directory" usign



legolas_w
September 7th, 2009, 01:07 AM
Hi,

Thank you for reading my post
is there any way to prevent a user from accessing a particular directory?
say we have a user named sec and a directory named /opt/noop and we want to prevent sec from accessing the directory or its sub directories

Thanks.

k33bz
September 7th, 2009, 01:11 AM
you want to jsut prevent that user from accessing this file or everyone but himn?

legolas_w
September 7th, 2009, 07:43 AM
Hi,
I want to prevent only that user from accessing the directory. later on I may add other users to the blocked list.

Thanks

Bodsda
September 7th, 2009, 07:53 AM
Hi,
I want to prevent only that user from accessing the directory. later on I may add other users to the blocked list.

Thanks

Removing his read write and execute permissions recursively should work

sudo chmod -R sec-rwx /opt/noop/
That command removes sec's read write and execute permissions from /opt/noop/
Syntax is

sudo chmod <arguments> <user><action><permissions> <directory>
Arguments: -R, for recursive
User: sec, the user who we want to remove permissions form
action: -, + or - depending on giving or removing permissions
permissions: rwx, r = read w = write x = execute
directory: /opt/noop/, The parent directory we want to remove permissions from

Hope this helps,
Bodsda

longtom
September 7th, 2009, 08:34 AM
Removing his read write and execute permissions recursively should work

sudo chmod -R sec-rwx /opt/noop/
That command removes sec's read write and execute permissions from /opt/noop/
Syntax is

sudo chmod <arguments> <user><action><permissions> <directory>
Arguments: -R, for recursive
User: sec, the user who we want to remove permissions form
action: -, + or - depending on giving or removing permissions
permissions: rwx, r = read w = write x = execute
directory: /opt/noop/, The parent directory we want to remove permissions from

Hope this helps,
Bodsda

Love this. Another bookmark....getting a bit cramped right now.

Hey - is this a squirrel in your avatar? You must be careful - there appears to be an invasion doing it's rounds....