2

I am wanting a custom look for my Ubuntu 10.04 users, so things like the shutdown menu are not displayed and just having one panel at the bottom of the screen. Also removing some of the default folders that get created like Music and Videos. I made a user (test1) and got it to look like how I want, I then copied the entire contents of /home/test1 to /etc/skel and set everything to be owned by root like it should be.

The problem is that when a user logs into the Ubuntu box none of the /etc/skel stuff get copied over. However a bunch of directories like Public, Music, Video and .gconf do get created. I know that /etc/skel only effects new users, so I might be looking in the wrong place.

What I want to have happen is the customizations that I have made get applied to the user who just logged in. I don't want those extra folders created or anything like that. How do I go about accomplishing that?

I am using Ubuntu 10.04 and have users home directories auto-magically mounted when they login using autofs to a NFS mount. The NFS mount contains the home directories of all the users currently in the LDAP directory. I am using OpenLDAP to authenticate my users. I have checked to make sure my user ID's are above what Ubuntu considers a system ID. I have also confirmed that if I delete the folders that Ubuntu creates from my home directory they get re-created upon next login. The same goes for the settings files (like .gconf). I do not know where these directories and files get copied from, but it is not /etc/skel as the created files do not contain any customizations.

Any ideas on how to solve my issue?

mdpc
  • 11,698
  • 28
  • 51
  • 65
kaptk2
  • 366
  • 2
  • 11
  • Those files(Desktop,Public,etc) are created by the running applications. Many applications will create files when they are not present, there is no single method or location, that all applications uses. If a user connected over SSH, they would probably not be created. Is there some reason why you aren't simply creating the files on the NFS server, when the accounts are created? – Zoredache Nov 09 '11 at 19:05
  • I don't make the folders on the NFS server because only a small part of the user base will need those files. Having the files created on the NFS server will create confusion for the users that do not login to the Ubuntu server. It also does not solve the issue folders being created that I do not want to have upon login to the Ubuntu machine. – kaptk2 Nov 09 '11 at 19:49

2 Answers2

2

I believe that specified files (EX: .profile and .cshrc) from /etc/skel are only copied when you invoke the newuser (or equivalent command) to create a new user. Aside from that it is not used.

mdpc
  • 11,698
  • 28
  • 51
  • 65
  • Right, I think you hit the nail on the head. /etc/skel is not being used. But something is creating those folders upon login, what is doing that and how dose one adjust that? – kaptk2 Nov 09 '11 at 19:54
  • The "other" folders I believe are created at the first invokation of the specific Linux GUI desktop by the user. – mdpc Nov 09 '11 at 21:12
0

That's because Ubuntu (at least in 9.10) doesn't use pam_mkhomedir.so to auto-create home directories by default.

Add this line to the bottom of your /etc/pam.d/common-account:

session required pam_mkhomedir.so skel=/etc/skel/ umask=0027

Magellan
  • 4,431
  • 3
  • 29
  • 53
  • pam_mkhomedir.so will only run if the directory does not exist. Since the directory does exist pam_mkhomedir does not appear to do anything. – kaptk2 Nov 09 '11 at 21:01
  • 1
    Historically, /etc/skel was generally used for creating home directories that didn't exist. If you're trying to copy stuff into existing ones, I'd suggest using pam_exec.so in /etc/pam.d/common-session to copy it in via a shell script. That one is going to run every time a user logs in though, if that's acceptable for your environment. (Edited because of the braindead comment editor behavior on StackExchange *grr*) – Magellan Nov 09 '11 at 22:03