Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
Remove read, write and execute permissions for generic users from everywhere else:
chmod o-rwx <everything else>
Particularly, make sure no folders have execute permissions - this will present users browsing them.
You can then set group permissions and add users to groups as appropriate.
i want that the particular user cannot even browse the /tmp folder (where the permission by default are 1777)
More so (Remove read, write and execute permissions for generic users from everywhere else:
chmod o-rwx <everything else>) doing this will make my many other process unworthy
Well, as roundabout as it seems, so far as I know, permissions are positive-based and not negative-based. I'm a relative newbie and might be entirely wrong, but I don't know of a way to remove permissions from one specific user other than removing them, entirely, and then granting them to users you DO want to have them.
Quote:
i want that the particular user cannot even browse the /tmp folder (where the permission by default are 1777)
so chmod o-rwx /tmp
Quote:
More so (Remove read, write and execute permissions for generic users from everywhere else:
chmod o-rwx <everything else> ) doing this will make my many other process unworthy
I don't know what you mean by "unworthy", but it won't affect anything at all if you manage your groups properly. Add the users you want to have permissions in certain areas to the group that owns that directory/file, and the users shouldn't even notice the permissions change.
I agree that it seems like a pretty inelegant workaround jsut to lock out one user, but it will work and it will result in a more secure system overall.
Originally posted by Rounan Remove read, write and execute permissions for generic users from everywhere else:
chmod o-rwx <everything else>
Particularly, make sure no folders have execute permissions - this will present users browsing them.
You can then set group permissions and add users to groups as appropriate.
--Rounan
I'm afraid that one isn't going to work (hence the need for a chroot environment as comp12345 said).
For example, when you type the command "ls", it looks at the directories in your PATH variable for an executable file called ls, then executes it. If you don't have execute permission on the directory that contains ls, you can't see it so you can't run the command.
In fact, if you do chmod o-rwx you won't even be able to log on as that user.
Creating a chroot environment has the same effect, but you get round this problem by providing local copies of commands you want the user to be able to run, as well as local versions of configuration files they need (e.g. /etc/passwd).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.