Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I am working on a CentOS 6 server and have Samba set up and have allowed ssh connections to the machine using our Windows AD authentication.
Currently, users in the allowed group are able to connect to the server without issue. The problem I am having is with the user's home directories.
Now, the home directories are automatically created when the user connects. I have these home directories specified to be created in the /disk1/home/%U area. This is because the first disk isn't large enough for our files, so thus I created a second, mounted it, and set up the home directories there.
Where the problem comes in is, when the user's connect, they are always sent to the root directory (/), not their home directory (/disk1/home/%U).
A little more info, so that what I'm looking for is more understood:
I know if i edit the .bashrc file within the user's home dir after it is created I can have the user start in the home dir easily.
Code:
nano /disk1/home/%U/.bashrc
Add the following line
Code:
cd /disk1/home/%U
But is there a way to have this automated? For example we add Joe User to the group who can access, and on his first access he gets sent right to "/disk1/home/joeuser" rather than "/"?
Last edited by mehetmet; 08-08-2012 at 10:03 AM.
Reason: code tags
After a little more research I found that the /etc/skel contaings a .bashrc file as well that is used as the "template" for new profiles.
As a secondary solution, I have added to the end of this file
Code:
cd /disk1/home
However, I am still looking for what variable I would need to enter to have it automate to "/disk1/home/username" I thought this was %U, but I'm assuming that is just like a samba config variable and isn't recognized here.
I think that /etc/skel must contain only the "parent" of the path to home directory (for local users, not samba users - that's different)
like in the example above link
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.