Question

Is it Possible to let multiple Users share the same home directory in Linux

Asked by: Rigged

Hey

I am trying to achieve having a single Home directory (/home/ds/) but allow multiple users (with different usernames ) to login via the GUI terminal.

The reason being why I need this is on most of our development PC's (all Debian Linux)  we have been using a single generic user (ds) for all the developers on all the machines - this is a obvious security risk and we need to give each Linux User their own login - but the problem is even though they all have different login names, now we need them all to use the same home directory as all of their scripts and procedures they use is dependent on the /home/ds directory and all them agreed that they want to keep it the home for all of them.

What I have done is setup a test PC as it is used currently, with the DS user and the home= /home/ds. I created a test user (called itest) and set its home and bash locations in /etc/passwd to the /home/ds directory. I created a group (genusers) and added the itest and DS user to that group. I then recursively chown the /home/ds directory keeping the ds user and setting the new group (genusers) as the group.

#chown -Rv ds:genusers /home/ds


When I login through the Terminal GUI as the DS user it works 100% the user can still access the home directory and functions as normal, but when I login with the itest user it comes back with an error about kstartupconfig. I then change the mode for the directory to give the group read write and execute rights:
#chmod 775 -Rv /home/ds


When trying to login then doesn't popup any error but throws you back to the login screen after flashing black for a second.
After the above II login with the DS user and it logs in with no problem, I then try to login with the itest user it brings up the login Splash (the one as it loads all the devices and bla bla bla) it get stuck their for a while and then finally it gives me a write error for /hom/ds/.ICEauthority


I have tried changing different permisions changed the modes and so forth but can't get it to work :(      Am I doing something wrong or am I missing something important?

Is it even possible to allow multiple login users (with different names)  to share the Same Home?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-06 at 04:27:07ID24630985
Tags

linux

,

user home

Topics

Debian Linux

,

Linux Setup

,

New Computer Users

Participating Experts
5
Points
500
Comments
11

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. cannot login -  changed root to /etc/passwd /bin/bas…
    Dear Linux experts. I was securing my Linux sendmail box, and while I was doing the security checklist by mistake I have edited root settings in /etc/passwd /bin/bash to /sbin/nologin as this Prevents access to the root shell and logs the attempt. And then I did the other...
  2. Debian and squid2
    Hallo Experts, I need a help with setup squid2 proxy on my debian 3.0 with kernel 2.4.18-bf2.4. Here is the situation: Recently I got ADSL connection which is working no problem at all. But the situation changed and I need to install Debian 3.0 and run squid to share intern...
  3. MSSQL and Debian?
    I am trying to install http://www.object-craft.com.au/projects/mssql/ on my Debian system, but when i try to build, i end up with the below. Also, my package list is at the bottom. hooch:~/Download/Asterisk/MSSQL-0.09# python setup.py install running install running build ru...
  4. Urgent: How to setup a samba share from DS Linux
    Hello all, I've got a Windows server with something corrupt, it can't finish the boot-up process. I need to get some data on it if at all possible, and the only thing our office had handy was a copy of Damn Small Linux .6. I'm a bit spoiled by the KDE and Gnome, don't kno...
  5. linux and windows file transfer without bash prompt
    How can a windows XP download a file from a linux box running RedHat ES4? They are connected via the internet. I know about PuTTY PSFTP. The only way I could figure out how to make it work was to give them bash command access in /etc/passwd myuser:/bin/bash Is there a way the...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: RBEIMSPosted on 2009-08-06 at 04:39:42ID: 25032107

I don't think that this setup would be possible. There are sockets that are opened in the home directory when the window manager runs. Normally there are also DBUS connections that are created and if two users try to use the same directory at the same time this would cause problems.
I would suggest that you created home directories for all the users and then created a symlink inside these directories pointing to the shared home. This way they could use their tools with minor adjustments and also could have private configurations.
I think the symlinks could even be created automatically when creating the users. Check /etc/skel, this is automatically copied to the new home when a new user is created.

 

by: renazonsePosted on 2009-08-06 at 04:45:27ID: 25032136

It may be possible but I think you'll end up with some crazy permissions problems in the end since the user's UID's will be conflicting and it would be more trouble than it's worth.

But, what you could do is have the files you need to be in common for the users relocated and use symbolic links.

So, each user's documents, desktop and whatever else can point to something like /home/common/documents and the user's documents directories would be symbolic links that point to the directories.

In this case the users will keep their typical unique libraries but share the necessary files.

I know you can use identical home directories for FTP and SSH like you've tried here by creating the group and applying the 770 permissions to everything but I don't think you're going to have much luck with actually having them login using the gui. Somebody else may have more insight on that setup.

 

by: renazonsePosted on 2009-08-06 at 04:46:16ID: 25032139

apoligies RBEIMS should've refreshed before sending.

 

by: omarfaridPosted on 2009-08-06 at 05:39:03ID: 25032518

The requirement is not clear. Do you need to give them the same login dir because they share the files and applications in that dir, or because you don't want to have a separate home dir for each one on the system?

If it is the first one, then you can let them all work from the same dir by setting some env variables and changing to that dir in their .profile files.

 

by: it4sohoPosted on 2009-08-06 at 10:35:10ID: 25035974

You're overthinking the problem...

Put all of your developers into one Linux group, then give the "common" home folder group permissions (including sgid)

1) Create your common group
    groupadd ds-users

2) Make each user have this group as their default group & share the same login directory
    HOMEPATH=/home/users/shared  # or wherever it will be located
    for u in user1 user2 user3 ... ; do
       usermod -d $HOMEPATH -g ds-users $u
    done

3) Change the permissions on the folder so that all of these users have write permissions
    chgrp -R ds-users $HOMEPATH
    find $HOMEPATH -type d -exec chmod g+rwxs,o+t '{}' \;
    find $HOMEPATH -type f -exec chmod g+rw '{}' \;


NOTE: The s permission for the group means all files created in that (those) folders will have the same group (ds-users), and the t permission means that files cannot be deleted except by the owner (which will continue to be someone different for each user) or someone who has write permission to the file (not just the folder). Finally, users will remain free to change permissions on their own files (or folders) to make them "private", should they so desire.

I hope this helps!

Dan
IT4SOHO

 

by: RiggedPosted on 2009-08-11 at 00:04:46ID: 25066697

Hey, Thanks for all the suggestions      -  I will try them out as soon as I get me a Test PC up and running again (shouldn't take to long :P ).

I some how managed to break my Authentication or something. I changed something somewhere (actually a few things in a few places and I didn't keep track of the changes :P ) after the changes It didn't want me to login with my normal users and the one console I had a user logged in on if I do ID it resturns everything fine except the User ID was 0 - so I think I broke something.

But none the less I will get a new TEST box up, try the suggestions and post what works and what doesn't :P

 

by: RiggedPosted on 2009-08-13 at 07:16:13ID: 25088459

Hey

THx Dan, I got it working as you suggested - SSH home directories is working, but the GUI logon through KDE it still gives the error "could not start kstartupconfig. Check your installation".

The owner of the home directory can logon no problem, but if the user is not the owner he or she can';t login (even though the group settings are set and correct).

:( Starting to believe it isn't possible - any more ideas?

 

by: it4sohoPosted on 2009-08-14 at 09:25:46ID: 25099853

check the permissions of the "hidden" files in the folder -- normally they will be set to owner rwx only, and in this case you'll need for the same permissions to be available to the group...

The 3 commands below will find ALL of the files in a folder (and below) and will add all user permissions to the current group permissions:

  find .??* -perm -400 -exec chmod g+r '{}' \;
  find .??* -perm -200 -exec chmod g+w '{}' \;
  find .??* -perm -100 -exec chmod g+x '{}' \;

The one "permission" I skipped is the SGID -- the user version (SUID) should NOT be set (unless you want all files within the folder to be owned by just one user), but the SGID should definitely be set (to force files created in those folders to be owned by the group.

With all that said, GUI interfaces make TONS of assumptions about login environments... it MAY turn out that you want to have separate login folders for each user (so they can have their own GUI settings), but a shared "project" folder... in which case:
 1) Create separate login folders for each user, separate from the "project" folder
 2) Create a symbolic link in each "home" folder to the "project" folder
     ln -s /path/to/project ~username
     (the ~username will be changed by the shell to the HOME folder of the user named after the ~ character)

Now, if you want to be REALLY tricky, take away user write permission on the login folder (but leave it on the GUI's . folders) -- then users cannot create new files or folders in their own home directory, but can move to the project folder and work there.

I hope this helps -- you'll either think "WOW" or "WTMI" (way too much information)... I hope it's the WOW! :-)

Dan
IT4SOHO

 

by: RiggedPosted on 2009-08-17 at 00:42:57ID: 25112198

Well Dan (IT4SOHO) so far I am thinking WOW :)  - thx for the advice thus far.

I ain't the most clued up Linux User, but just correct me if I am understanding you incorrectly (I aint to sure what you meant by the SUID and SGID stuff you mentioned)   :P

From what I can gather we are thinking in the same direction (I hope so :P), but what I did so far is make a homepath script that I can run and just changing the users required in the file.
The Code Snippet is the script I run - put together from the commands/suggestions given in above posts. When I run the script, it gives the following as the output:
__________
usermod: no changes
usermod: no changes
chmod: cannot operate on dangling symlink `/home/ds/.kde/socket-monarch-deb64VM1'
chmod: cannot operate on dangling symlink `/home/ds/.kde/tmp-monarch-deb64VM1'
chmod: cannot operate on dangling symlink `/home/ds/.kde/socket-monarch-deb64VM1'
chmod: cannot operate on dangling symlink `/home/ds/.kde/tmp-monarch-deb64VM1'
chmod: cannot operate on dangling symlink `/home/ds/.kde/socket-monarch-deb64VM1'
chmod: cannot operate on dangling symlink `/home/ds/.kde/tmp-monarch-deb64VM1'
__________


Also when I try to login to the GUI now after running the script, It doesn't give any error, but the screen flashes black for a second and then returns back to the login screen (it does it for both the users I am testing with "ds2" and "ds3" as it is in the script I posted).
Below is the output from /var/log/auth.log for the login attempts (2 failed for the ds2 and ds3 user and one successful for the ds user).
Is there a reason why it shows the uid as being 0?
__________
Aug 17 09:09:41 monarch-deb64VM1 kdm: :0[9586]: pam_unix(kdm:session): session opened for user ds2 by (uid=0)
Aug 17 09:09:42 monarch-deb64VM1 kdm: :0[9586]: pam_unix(kdm:session): session closed for user ds2
Aug 17 09:09:50 monarch-deb64VM1 kdm: :0[10579]: pam_unix(kdm:session): session opened for user ds3 by (uid=0)
Aug 17 09:09:50 monarch-deb64VM1 kdm: :0[10579]: pam_unix(kdm:session): session closed for user ds3
Aug 17 09:32:40 monarch-deb64VM1 kdm: :0[10609]: pam_unix(kdm:session): session opened for user ds by (uid=0)
__________


usermod -a -G ds-users ds2               #Add users to ds-users group
usermod -a -G ds-users ds3               #Add users to ds-users group
 
HOMEPATH=/home/ds                        #Homepath Directory
        for u in ds2 ds3 ; do
                usermod -d $HOMEPATH -g ds-users $u
done
 
chgrp -R ds-users $HOMEPATH              #Set group on HomePath
    find $HOMEPATH -type d -exec chmod g+rwxs,o+t '{}' \;
    find $HOMEPATH -type f -exec chmod g+rw '{}' \;
 
#Change/Duplicate permissions on home hidden files for user to group
    find $HOMEPATH/.??* -perm -400 -exec chmod g+r '{}' \;
    find $HOMEPATH/.??* -perm -200 -exec chmod g+w '{}' \;
    find $HOMEPATH/.??* -perm -100 -exec chmod g+x '{}' \;
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:

Select allOpen in new window

 

by: RiggedPosted on 2009-08-26 at 03:10:46ID: 25185894

Well never really got this working - Thanks for all the tips and advice given

 

by: marcrieraPosted on 2009-10-20 at 11:18:33ID: 25616905

Rigged:

There has been a lot of good tips here, but I have an extra one.

1)Go to /etc/groups and add each user on the other user group.
2) chmod g+w -R user1
3) chmod g+w -R user2

This will do the trick.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...