DeLightNight
Posts: 48
Joined: Tue Apr 21, 2015 8:00 pm

Chmod

Sat Nov 14, 2015 6:50 pm

Hello i
chmod 0
a directory in my desktop with a non-root user how is it possible? how to disable this option for normal users?
2nd question:
3 users:
- root
- usr1
- usr2
how to do that usr1 can't access usr2 stuff? (I think root can access everywhere anyway... let me know if I'm wrong).
OMG THE KID THAT ANSWERED THE QUESTION IS ONLY 16 :O

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Chmod

Sat Nov 14, 2015 10:50 pm

If you own it, you can chomd it.
(not being able to control things you own isn't really a Unix thing, maybe you want Windows :-)

If you want to keep a user out of your files make sure they don't belong to any group that has any permissions or remove group permissions.
Post the output of:

Code: Select all

id usr1
id usr2
ls -ld ~usr1

DeLightNight
Posts: 48
Joined: Tue Apr 21, 2015 8:00 pm

Re: Chmod

Sun Nov 15, 2015 1:55 am

here
Attachments
Screen Shot 2015-11-14 at 8.54.59 PM.png
Screen Shot 2015-11-14 at 8.54.59 PM.png (15.97 KiB) Viewed 912 times
OMG THE KID THAT ANSWERED THE QUESTION IS ONLY 16 :O

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Chmod

Sun Nov 15, 2015 2:25 am

DeLightNight wrote:here
( next time copy&paste the text into a CODE block, much easier to work with....)

asaf's homedirectory has world read-execute permission meaning _anyone_ can change into this directory and read if (i.e."cd" and "ls" work).

just run chmod 750 ~asaf or chmod 700 ~asaf to remove these permissions from "world" and optionally "group" as well (moshe doesn't belong to the group so the latter isn't needed)

Hydranix
Posts: 9
Joined: Mon Nov 16, 2015 5:33 am

Re: Chmod

Mon Nov 16, 2015 9:36 am

To make your /home directory more secure and ensure that you other users cannot view or enumerate your files, run these commands.

Code: Select all

USER1=$UID
USER1HOME="~/"
sudo chown -R $USER1 $USER1HOME
chmod $UID:$GID 0750 ~/
That will set user and group for your home directory and all submits and files to your user and group.
After that it sets your home directories permissions to:
Only You = Read/Write/Execute
Your group = Read/Write
Everybody else = nothing

Return to “Advanced users”