Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
chmod 700 <filename> will give the owner full permission on the file, and others no permissions at all. I don't think that will actually hide the file, but it will mean no one else can read it.
Alternatively, to hide everything in the directory, use chmod 700 <directory>. This will actually hide the directory contents from other users,
after changing to 700, i have got:
You don't have permission to access / on this server.
Quote:
Originally posted by trevelluk chmod 700 <filename> will give the owner full permission on the file, and others no permissions at all. I don't think that will actually hide the file, but it will mean no one else can read it.
Alternatively, to hide everything in the directory, use chmod 700 <directory>. This will actually hide the directory contents from other users,
i am kind of new at this, but i am pretty sure that if u chmod 770 that will give the owner and all users in ur group full permisions, but then everyone else will have no permissions. if u have a home comp this should work ok, but if u r in an office where there are multilple people in ur group then they would have full permissions to you stuff. if u use chmod 700 then u have to be root or the person who created the file. you could use chown to make all the files urs, but i dont know how to use it or if it will screw things up if u try it on system files. one guy did chmod 777 / and couldnt boot any more, so some things are better left alone
Don't hide your root directory. Many programs that need to run, run under their own user names. If you hide the root directory, they will not be able to read the /etc files or load in library files.
Your personal files will be in your home directory so that is where you want to change the permissions.
First check if there is a group by the same name as your user name. If not create it. Then change the group ownership of your own home directory to that group, and make that your primary group. Now reset the 'other' bits of the directory: chmod o-rwx /home/username
By clearing the execution bit of a directory for 'others'. Other users will not be able to enter your directory. If you are paranoid, you can change the permissions of all of the files and directories in your home directory using the -R option.
You can search for files with other permissions set using the find command.
find ~/ -perm +o=rwx
Also, edit your ~/.profile to change the umask number to something like 0027
This is your file creation mask. If a program you are running creates a file with a file mask of 0755, the other permission bits will be masked out (i.e. cleared).
Your linux distribution probably has a service running periodically which will check permissions and reset them to default for certain directories. They have a gui configuration program that allow you to enter a directory and the default permissions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.