Arch Linux - how to not let other admin accounts view your files

im using arch linux with gnome. i have a my main user which i use and another user with an admin account. the root has separate password my account has separate password and the other admin account also has separate password. when the other admin login to his account he can go to home directory and my account and open with his password. i dont want the other admin account to be able to do that. what is the point of separate users if any admin account can open other admin accounts files with their password.

Encryption.

IF you don’t trust the other user, why is he an admin?

But anyway…whichever OS… if you have a user with admin they can fully administer the machine. The only way to protect your content is to encrypt it - with a key that the other user(s) do not have.

2 Likes

Yep. Encryption is the only way. I am also curious as to why this person has admin if you don’t trust them.

1 Like

technically you can allow only certain commands to be used for some user in sudo. so if you don’t want them to be able to do and see everything, but you want them to manage, say a db, you can allow db commands in sudo for that user but not other.

that said, best to give root perms to only people you trust, and keep confidential data encrypted and separate

3 Likes

IN theory yeah, but some software that you may not consider may enable you to write files or spawn a shell :slight_smile:

e.g.

https://www.dionach.com/blog/postgresql-9x-remote-command-execution

So yeah. I generally treat sudo as all or nothing, because it’s just too damn hard to be aware of all the ways software can be abused with root to get futher access… :slight_smile:

3 Likes

the other person is family member. i trust him but i don’t want him to see what files i download and all. ok so the only option i have is to either encrypt my home folder or make the other account standard instead of admin.

Pretty much.

If you don’t encrypt, you’ll also want to make sure the permissions on your home folder’s main folder are chmod 700, as this will prevent “group” and “other” (i.e., the other guy’s user account) from traversing the folder.

e.g.

  • sudo chmod 700 /home/yourusername

But be aware, if you haven’t encrypted your stuff, then there’s nothing to stop him say, booting from a USB live install and snooping around your stuff that way (because within the live-image, he will have root access and then that applies to any filesystem he opens from the live-usb install). Even if you remove him from admin access.

Depends how determined he is, and how likely you think that is.

If you think that he might go further than just casually browsing the system from within his own account, then encryption is the only option.

2 Likes

^ This.

Just a heads up. This is not a *nix-ism. This would be true for any OS. Administrators are … administrators. There is no way of getting around that. If you cannot see why that person would need to ability to admin the box, then drop the rights down.

Pro-security tip: All users should have least privileges needed to perform their tasks.

Power corrupts and absolute power corrupts absolutely. In this case, that could be your HDD :wink:

1 Like

so it means even if you think you are safe, anybody can boot up a live usb, and open up anyone’s files. i thought linux is secure. and setting permission 700 seems like good option i will try it. thanx.

i tried changing permissions did not help. so now i made the other account standard. but it still worries me that anyone can view your files by live usb :thinking::sweat:

Build an entirely chrooted directory structure which looks exactly like the file system. Next, set it up so every time the adversary admin ssh’s in, they’re logged into the chrooted directory. If they are newb admin, they’ll never know.

#securitythroughobscurity

2 Likes

by the way can you tell me, how can i encrypt my home folder. :smiley:

Security through obscurity works… until it doesn’t. Only keeps the honest people honest.

1 Like

Why would they have an admin account in the first place (i assume you mean an account that can access the root user?)

And if you’re worried about them seeing your files, then you must be placing the same worry on their behalf? How are you ensuring you cant see their files?

1 Like

:point_up_2: TRU.DAT

lol :smiley: i mean like when i used windows each admin account was seperate they cannot access another admin account’s files. i dont know why linux doesn’t have that feature. i wanted to give the other account admin rights so that he could install a software or anything that requires root permission, so if im not around or something he can get his work done.

^ In Windows, that depends on how you set that up, unless that has changed in Win10 Server2018. Once you start adding AD Domain credentials, it can get even more muddy.

Security starts with a good baseline. You can get what you are looking for in the *nix world, but it requires setup and understanding of the tools. Basically I recommend setting permissions and locking down the root account and the sudoers file/group. That will get you mostly what you are looking for. By default, users do not have access to each other’s files on the *nix environments. IF you take the drive out and mount it on another system, you mileage may vary.

If you take a Windows drive out and place it into another Windows machine or *nix machine, you will be able to read the other person’s files. On the *nix environment, your basic Windows permission system will have no baring and you will be able to see all of the things and modify them on that drive.

i already tried changing my home folder permissions to 700 didn’t help. and the other account is not in the wheel group only my account is in the wheel group.

Sure but which group is the sudoers group using. Standard now is to use a sudo group instead of wheel. Also with the sudoers file, you can specify which users are able to escalate and what they can escalate. Basically, think of a whitelist.

If you are talking about setting permissions to 700 and then putting in another machine, that will not help much. If you are talking about setting permission to 700 and the user can still see things without escalating, then something else is wrong with your system.

Coming out of left field:

Edit the sudoers file and limit their admin privileges?

Edit the sshd config and limit their directory access?

1 Like