Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to combine 2 user /home folders in a smart way.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Tue Sep 17, 2013 4:04 pm    Post subject: How to combine 2 user /home folders in a smart way. Reply with quote

I run Gentoo as a single user. However recently I got the need to divide my /home folder to two separate user accounts. One for work to store all the documents applications and such. The other for more private content like games, movies etc. This is necessary, because I need separate configs for firefox, libre office, mail client and also I wouldn't have any distractions if I login to my work account.

However there's a "gray area" - some things that can't be pulled to either account. This includes music library, desktop environment config (KDE) and other config files and folders.

So my question is: Is there a clever solution to this problem ?

I was thinking about making 3 user folders like private/work/shared and the first two would have symlinks to the shared content. However I'm concerned about read/write permissions in the shared folder.
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9755
Location: Córdoba (Spain)

PostPosted: Tue Sep 17, 2013 5:02 pm    Post subject: Reply with quote

So, you want to have access to everything at a given moment, but you want different views for that content, right?

It seems like kde activities to me. Not that I am a fan of that, but I think it's worth a try on your situation. That, along with firefox profiles can surely do what you want. I can't suggest anything about libreoffice though ;)
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Tue Sep 17, 2013 5:26 pm    Post subject: Reply with quote

no no no... KDE activities won't do. It has to be a hard separation.
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9755
Location: Córdoba (Spain)

PostPosted: Tue Sep 17, 2013 5:36 pm    Post subject: Reply with quote

So, you want separate user accounts and some shared folders.

I'd personally keep stuff like music and that kind of general massive data outside home dirs. Just create a directory under /mnt, and adjust the permissions the way you want. Usually, for desktops, you can get along with some kind of user:group schema. To keep the permissions ok you can use some kind of cron script, or even an inotify based script (that could be costly if the fs is massive). If you need finer control look into ACL.

If you want some more insight into something regarding this just ask.

---

However I don't understand what are you exactly meant to do with the kde configs... if I understood correctly, you want "hard separation" but you want to share the same desktop config? If so, I really can't understand why a single user account won't fit you. If you don't like activities, you don't have to use them. KDE also supports the traditional desktop paradigm.

In any case, good luck with that... if you have been a kde user for some time, you surely know that kde apps can't even handle version updates properly sometimes. So I wouldn't hold my breath for the kde config being shareable between two user accounts, specially, now that the pim and semantic stuff is now mandatory with the new .11 release :roll:
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1225
Location: 42.68n 85.41w

PostPosted: Tue Sep 17, 2013 5:41 pm    Post subject: Reply with quote

ln -s /home/user/music /home/office/music..... etc etc etc i keep everything in home because its the storage partition on my system. symlinks can make files and directories jump between users easily. chmod + chgrp and give group permissions to edit stuff like previous poster said.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Tue Sep 17, 2013 6:25 pm    Post subject: Reply with quote

I already said that I was thinking about symlinks, but there's an issue with permissions.

Let's say that one of the "users" wants to delete a music file. If he's not the owner he can't do it. Using group permissions here is even more annoying, since it would require a "chmod +rwx user:group" to be done all the time. I'd sooner go with no permissions at all.

EDIT:
Maybe I should use ACL ? Is it dangerous (can it cause damage to my files if I switch it on or off ) ? Would it influence performance on an SSD (or read-write time in general) ?
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9755
Location: Córdoba (Spain)

PostPosted: Tue Sep 17, 2013 6:42 pm    Post subject: Reply with quote

Gabriel_Blake wrote:
I already said that I was thinking about symlinks, but there's an issue with permissions.

Let's say that one of the "users" wants to delete a music file. If he's not the owner he can't do it. Using group permissions here is even more annoying, since it would require a "chmod +rwx user:group" to be done all the time.


Yes. And I suggested two ways to automate that above, namely:

a) cron, if you don't mind some delay
b) inotify based script, if you want it to be "real-time"

Quote:
I'd sooner go with no permissions at all.


That's exactly what you are describing anyway. If you want everyone to be able to write and read these files, there are many ways to do it. You could re-mount a local directory as a world-writable samba-share, or you could use an vfat volume, since their permissions are emulated at mount time (read on umask and dmask mount parameters for it).

For more "professional" solutions you could use a local ftp server, since about any modern file explorer (even mc) supports that, so you won't even need to deal with networking stuff, and you will manage them just like any other local file. That will give you the extra capability of being able to get your files from virtually anywhere. If you plan to use it from the outside, be sure to choose ssh or sftp instead.

EDIT. About acls, well, I think you are gearing towards simplifying your permission scheme. ACL is usually use for quite the opposite. I don't think it's what you want.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Wed Sep 18, 2013 8:46 pm    Post subject: Reply with quote

I think we're looking at this from two different perspectives.

The samba/vfat/ftp solution could work for files like music and such. But the point of this is to share things like "/home/user/.kde4" - to have the same kde environment when I log in as either user (this is just an example, I know that in the case of kde this may cause problems). So the sharing method has to be completely transparent for any type of file access.
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9755
Location: Córdoba (Spain)

PostPosted: Wed Sep 18, 2013 9:17 pm    Post subject: Reply with quote

You can't simply look at this with one single perspective, and that's because you are mixing appels and oranges (or config files with regular user data files, as you wish).

Now, from your last post, I know that you know that kde WILL give you trouble.

If what you want is to share data files, several solutions have already been presented, and all of them will work ok. You might like one better than the rest, but they will work.

If you want to share config files, you will be depending highly on which kind of config file... there's no straight universal way to share that, it depends on the concrete config file. You can share a .bashrc file, or tmux and screen configs, or mc menus, but you can't (I bet) just share ~/.kde4 and hope that it will work out of the box. On kde4, the ~/.kde4 directory surely holds much more than simple key=value files, surely you can find user credentials and other info that's deeply tied to the user account. Even the mail lives there if you use kdepim (last time I checked was years ago, though...).

If you truly want the same exact desktop setup, please, tell me why a single user account won't work for you. Give me the reasons, maybe we can rethink this somehow. I think you are looking for an overly artificial solution for a problem which is several orders of magnitude lesser than you think it is.

I am curious. :D
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum