LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Private directory (https://www.linuxquestions.org/questions/linux-newbie-8/private-directory-755297/)

sabahh 09-15-2009 03:56 AM

Private directory
 
How do i create a simple private directory in linux as a regular user ??

centosboy 09-15-2009 04:02 AM

Quote:

Originally Posted by sabahh (Post 3683317)
How do i create a simple private directory in linux as a regular user ??

private as in only you can access it right?

one way is to -
create the directory with the permissions 700.

Code:

mkdir -m 700 directory_name
only the directory owner has full access rights here.

mobinskariya 09-15-2009 04:04 AM

change the permission of your folder by
Code:

mkdir yourdirectory
chmod -R 700 yourdirectory

note:root can do anything(even change the permission or ownership) in your directory and you cant restrict him any way.. he is the GOD of the machine.

linuxlover.chaitanya 09-15-2009 04:04 AM

Private directory? Do you mean a directory that is not accessible to others?
If this is what you want, create a directory with

mkdir /path/to/directory

And change the permissions on it. If you do not even want others to read

chmod 700 /path/to/directory

Ok. centosboy and mobin beat me on this with couple of mins. But this as fast as I can type.

mobinskariya 09-15-2009 04:07 AM

@ linuxlover.chaitanya :D :p


All times are GMT -5. The time now is 08:02 AM.