LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-08-2012, 09:51 AM   #1
mehetmet
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Rep: Reputation: Disabled
Question Samba Home Directory


Hello,

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).

Any idea why this would happen?
 
Old 08-08-2012, 10:01 AM   #2
mehetmet
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
Old 08-08-2012, 12:17 PM   #3
mehetmet
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.


Any thoughts?
 
Old 08-08-2012, 12:30 PM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

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
Code:
HOME=/home
that would create a user directory in /home
like
Code:
useradd -s /bin/bash usertest1
will be /home/usertest1
 
1 members found this post helpful.
Old 08-09-2012, 07:30 AM   #5
mehetmet
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for the help!
 
  


Reply



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
Samba home directory over nfs? struggled_newbie Linux - Server 1 10-13-2011 11:56 PM
Samba Home Directory Trouble JeffC1 Linux - Newbie 1 07-04-2008 10:11 AM
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 12:40 PM
Samba Home Directory bodhisattvia Linux - Software 0 07-12-2005 08:42 AM
How can home directory from another computer using Samba linuxeagle Linux - Networking 1 02-05-2004 01:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration