LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-10-2007, 11:00 AM   #1
mschutte
Member
 
Registered: Jan 2005
Location: Innsbruck, Austria
Distribution: Debian GNU/Linux Lenny
Posts: 68

Rep: Reputation: 15
Users' home directories as symbolic links


Hi LQers,

I want to set up a system which allows users to authenticate using PAM/Winbind. The home directory will be mounted by libpam-mount, but I do not want the users' configuration files to loosely lie around in their private directories, because they will use it with Windows, too. My current idea is the following:
  • User logs in on a virtual terminal or using a display manager.
  • An empty directory is created in the tmpfs that is mounted on /var/users (or something like that); this is required to be a RAM filesystem, because the root filesystem is a read-only NFS.
  • The user's private directory (smbfs) is mounted there.
  • A symbolic link to /home/$USERNAME is created from /var/users/$USERNAME/.dotfiles; if necessary, the latter directory is created before, ideally by copying /etc/skel. Sadly, due to the nature of SMB shares, I cannot mount .dotfiles directly.
  • The user's shell or desktop environment starts up.

My problem is that I don't know how to do the symlink creation. Is there a PAM module which works that way? Will I have to write one myself? I would also be happy if you could suggest another place, probably between PAM finishes its work and the user's environment starts; it must not except the home directory to exist yet, and the user must not find a way to sail around it (thus, /etc/profile or Xsession are a problem).

I greatly appreciate all your ideas.

Thanks in advance,
mschutte
 
Old 04-11-2007, 09:58 AM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
I've had weird things happen when trying to use a symlink for a home directory. I don't remember exactly, but some software didn't work.

Anyway, it sounds like you're going to try and use SAMBA for remote home directories in Linux--this is a bad idea because file permissions won't work properly. Instead, you should export /home as a read/write NFS share. Do NOT share /home in SAMBA. Instead, create an independent directory tree; perhaps /smbhome. This directory tree is for everyone's personal documents. In each home directory, include a symlink to that user's smbhome personal folder. For example, you could have /home/isaac/MyDocs be a symlink to /smbhome/isaac/

Tell your users that if they want to be able to access their files in Windows, they'll need to save them in their "MyDocs" folder. Otherwise, the files will only be accessable in Linux.

Of course, there are a lot of settings files which get saved in the user's home directory without giving any option for saving them somewhere else--these files are generally hidden as well as useless in Windows.
 
Old 04-11-2007, 12:00 PM   #3
mschutte
Member
 
Registered: Jan 2005
Location: Innsbruck, Austria
Distribution: Debian GNU/Linux Lenny
Posts: 68

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by IsaacKuo
Anyway, it sounds like you're going to try and use SAMBA for remote home directories in Linux--this is a bad idea because file permissions won't work properly. Instead, you should export /home as a read/write NFS share. Do NOT share /home in SAMBA.
Well, that sounds logical, but there is a problem with it: If I understand NFS correctly, every user can write to the other users' home directories and manipulate their settings, because I cannot require the users to authenticate to it—users could bring their notebooks, on which they naturally are root. Will I have to set up Kerberos or are there any better ideas?

Anyway, thank you for your help.
mschutte

Last edited by mschutte; 04-11-2007 at 12:04 PM.
 
Old 04-11-2007, 01:34 PM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
Hmm...maybe something like sshfs would be better for you. I've never used it myself.
 
Old 04-11-2007, 02:04 PM   #5
mschutte
Member
 
Registered: Jan 2005
Location: Innsbruck, Austria
Distribution: Debian GNU/Linux Lenny
Posts: 68

Original Poster
Rep: Reputation: 15
Hehe … I just thought about that as I received the notification mail. I'll try it as soon as possible and report back here. :-)
 
  


Reply

Tags
pam, symlink


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP virtual users with different home directories remi Linux - Software 14 07-27-2009 11:20 AM
Symbolic Links, directories, and relative paths (../). Can it be done? jimwillsher Linux - Newbie 1 03-11-2005 05:27 PM
mkisofs & symbolic links to directories Imek Linux - General 1 10-28-2004 06:32 PM
How to bind users to their home directories? trees Linux - Security 6 09-16-2004 05:32 PM
Symbolic links bkmesenbrink Linux - Newbie 2 11-13-2002 11:54 AM


All times are GMT -5. The time now is 03:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration