Can root and my main user account share the same home directory?
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.
Can root and my main user account share the same home directory?
Or would this sacrifice security in some way?
I've been using root only, and am ready to have a seperate account now.
It's the dotfiles for GUI apps that I'm concerned about:
Code:
-rw------- 1 root root 98 Feb 13 16:23 .Xauthority
-rw------- 1 root root 6392 Feb 12 18:13 .bash_history
drwx------ 5 root root 4096 Jan 13 17:47 .config
drwxr-xr-x 4 root root 4096 Dec 29 21:36 .fvwm
drwx------ 4 root root 4096 Nov 7 19:55 .mozilla
-rw------- 1 root root 218 Jan 26 10:04 .recently-used.xbel
-rw------- 1 root root 98 Feb 13 16:23 .serverauth.17096
drwxr-xr-x 2 root root 4096 Dec 25 12:42 .tuxcmd
drwxr-xr-x 2 root root 4096 Feb 12 17:25 .xine
im not acualy sure but i belive it would be a security risk if both root and user had the same home directory. its like lets say your user pass was compromised the hacker would then have acess to the folder thats both root home and user home and all files/directories associated which is a reason why root is seperated.but why do u want them to be the same? root can acessed all directoies on the computer any ways. so if you made a user account and needed acess with root you could acess the user directory. you just couldnt acess root home dir with the user tho.
For an unprivileged user to be able to write to /root or any other user home would require that directory and files to be readable and writable by both users. Now "root" by design is not an account to ever be used for day to day tasks as it holds the keys to the castle (owns user auth, starts daemons, owns files no other users should have write access to) and it is the most "trusted" account on your machine. So as unprivileged user fscking up root (say writing to a file root then reads) could potentially lead to Interesting Things.
Quote:
Originally Posted by rivercat
I've been using root only
Whatever reason you think you had for doing that it's not valid.
That just is not the way to do things.
Quote:
Originally Posted by rivercat
It's the dotfiles for GUI apps that I'm concerned about
Copy them to some other directory, replace "root" with the unprivileged users account name in the files, then copy them to the unprivileged users directory and chmod and chown them. If that doesn't work for some files (binary contents) and results in trouble then just remember you caused this yourself.
I was thinking more like adding root and the main user to the same group (users?, NOT wheel or adm).
Then making the /home dot files & subdirectories owned by this group.
Files for root only can stay securely in /root.
Why don't you just copy or move all the dot-files and dirs, and chown them to the
normal user?
Because then every configuration change in one account has to be repeated in the other account.
My text editor (leafpad), file manager (tuxcmd), and firefox only use per-user config files, not system-wide ones.
Sorry to be so long in getting back . . . damn clients and their deadlines!
>>Good idea Clachair, but even if root owned the symlink,
>>can root write to the target directory's files, which are owned by the user?
Yes, root can write in/to any directory files. In fact, I use a root chron job to read/write into a user's directory via a symlink every night. This stops the user from messing with the chron jobs, since the symlink doesn't show up in his directory list.
John
Last edited by Clachair; 02-21-2011 at 07:23 PM.
Reason: typo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.