LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Roaming Profiles via LDAP, Samba, Lam ... Help! (https://www.linuxquestions.org/questions/linux-networking-3/roaming-profiles-via-ldap-samba-lam-help-372483/)

Elijah 10-12-2005 10:13 PM

Roaming Profiles via LDAP, Samba, Lam ... Help!
 
I managed to get Openldap work in our fedora3, then LAM, Samba looks ok ...

I could authenticate as a different user via ldap but their home directories are stored locally(whichever pc I logged on) ...
$su USER
$cd ~/
Quote:

localhost://home/USER/ <-- directory not found!
what I wanted is that each user should have their own home directory in the ldap+samba server itself each logon. And those directories should automatically create itself when it's the user's first logon.
$su USER
$cd ~/
$pwd
Quote:

server02://home/USER/ or
192.168.100.1://home/USER1 or
192.168.100.1://home/USER2
How should I do this?

I followed this howto btw:
http://tlug.dnho.net/?q=node/146#comment-145

dhruvypatel 10-13-2005 12:47 AM

Hi,
For automatically creating user's home directory you need to setup automount. You can setup automount using /etc/auto.master. In that file write a line as below.

/home /etc/auto.misc --timeout=60

Then add one line in /etc/auto.misc as below.

* rw,soft,intr ldapserver:/home/&

I don't remember the exact portion of permission parts. If any mistake is there then you can see it in comment line of /etc/auto.mis.

Then restart the autofs service and you have done.

NOTE: You r doing automount on /home directory which is already mounted. So before doing this you have to unmount it. But doing so will effect local users. So what you can do is change the home directory of ldap users to /home/ldap/USER. If you are automountin this way then you need not to umont the /home directory. Only you need to change the /home in auto.master file to /home/ldap. I hope you are clear about what I am saying. This will solve your problem.

Elijah 10-13-2005 01:33 AM

but my /home is not partitioned and is part of root "/" ... will this umount/mount the entire root directory? :eek:

dhruvypatel 10-13-2005 01:42 AM

Then it is not mounted right? what you can do is just use mount command to show which drives are mounted on which directory? if it is not showing /home entry then no need to unmount just do automount.

Elijah 10-13-2005 02:04 AM

Okies, i setup autofs & restarted smb, ldap & autofs.

I created another user named 'last' and tried to login to another pc within the network:
elijah@ubuntu:~$ su last
Password:
last@ubuntu:/home/elijah$ pwd
/home/elijah
last@ubuntu:/home/elijah$ cd
bash: cd: /home/ldap/last: No such file or directory


Logging on as user 'last' to the main server:
[root@server02 ~]# su last
bash-3.00$ ls
bash-3.00$ pwd
/root
bash-3.00$ cd
bash-3.00$ ls

typing 'ls' in the home directory of 'last' froze the server ... what happened?? :confused: I had to reboot and try again, then it froze as I try to list down the contents of /home/ldap/last/ ... weird.

The logging in for other pc's sets the ldap user to use the home directory of the local pc... instead of the server's. :(

Elijah 10-13-2005 02:19 AM

can I use something like mounting nfs shares automatically?
each time a user logs on one of the machines, the client connects to the main ldap/samba/nfs server & mounts an nfs share based on who the user is ... is there an app that does just that?

localuser@localhost$ su ldapuser
Password: ******
(client automatically gets a mounted /home/ldapuser nfs share from the server)
ldapuser@localhost:$

dhruvypatel 10-13-2005 11:21 PM

Hey you have to create autofs entries on the each client machines from where you want to login. So do one thing remove autofs entries from the server and setup it on client side.

Elijah 10-14-2005 01:06 AM

So I should put in the lines:

auto.master:
/home/ldap /etc/auto.misc --timeout=60

auto.misc
* rw,soft,intr 192.168.100.1:/home/ldap/&


for each client then? ok, I'll try that later after work ... the server I'm working on is actually our development server, I don't want to freeze it again while testing autofs :D

Elijah 10-14-2005 05:28 AM

I did the following:


elijah@ubuntu:~$ sudo /etc/init.d/nscd restart
Stopping Name Service Cache Daemon: nscd.
Starting Name Service Cache Daemon: nscd.

elijah@ubuntu:~$ sudo /etc/init.d/autofs restart
Stopping automounter:

Stopped 16080
done.
Starting automounter: /home/ldap.

elijah@ubuntu:~$ su test
Password:
test@ubuntu:/home/elijah$ cd
bash: cd: /home/ldap/test: No such file or directory


I'm afraid it didn't work ... :(

Elijah 10-14-2005 05:29 AM

got a working howto for autofs+samba+ldap?

dhruvypatel 10-14-2005 11:10 PM

You may put wrong entries in auto.master and auto.misc. Now what you can do is just login with the ldap user and see the error. Which directory is it showing? For example if it is showing /home/USER is not found then you probably put the entries like below assuming that at server side you have the /home/USER as home dirctory.

auto.master
/home /etc/auto.misc --timeout=60

auto.misc

* -rw,soft,intr 192.168.100.1:/home/&

If server side you have home directory different than /home/USER say /home/ldap/USER then you have to change auto.misc entry as below.

* -rw,soft,intr 192.168.100.1:/home/ldap/&

The auto.master entry will remain the same. It may be different depending on client side entry. For example if you get error like /home/ldap/USER directory not found then you have to replace /home with /home/ldap.

NOTE: Remember one thing the dirctory entry which is in the auto.master file must be exist on the system. If it is not exist then manually create it.

Elijah 10-20-2005 08:29 PM

I've changed the entries:

SERVER side: (auto.master)
/home /etc/auto.misc --timeout=60
SERVER side: (auto.misc)
* rw,soft,intr 192.168.100.1:/home/&

CLIENT side: (auto.master)
/home /etc/auto.misc --timeout=60
CLIENT side: (auto.misc)
* rw,soft,intr 192.168.100.1:/home/&

I try to get in from the client side:
Quote:

elijah@ubuntu:~$ su test
Password:
test@ubuntu:/home/elijah$ pwd
/home/elijah
test@ubuntu:/home/elijah$ cd
bash: cd: /home/test: No such file or directory
test@ubuntu:/home/elijah$
getting in from the server side:
Quote:

[root@server02 ~]# ls /home/
nolimel
[root@server02 ~]# mkdir /home/test
mkdir: cannot create directory `/home/test': File exists
[root@server02 ~]# ls /home/
nolimel test
[root@server02 ~]# su test
bash-3.00$ cd
bash-3.00$ pwd
/home/test
bash-3.00$
Well, it worked for the server ... but the client can't find mount it's own home directory 192.168.100.1:/home/& from the server ... :confused:

I use lam (ldap account manager) to create & edit user ldap+samba entries ... the test user's unix home directory is set to /home/test , the samba3 home path is set to nothing " " ... maybe that could be the problem? :scratch:

dhruvypatel 10-20-2005 11:26 PM

Hi,
Don't try to login by su. Login direct in to terminal. and send me the exact error you are getting. I'll send exact entries for auto.master and auto.misc.

Elijah 10-21-2005 01:35 AM

I get:

No directory, logging in with HOME=/

dhruvypatel 10-21-2005 11:55 PM

This error seems new to me. Any way assuming /home/USER is your home directory at server and client side both.


Client side entries:

auto.master:

/home /etc/auto.misc --timeout=60

auto.misc:

* -rw,soft,intr 192.168.100.1:/home/&

At server side comment out all entries in auto.master and auto.misc. There is no need to implement autofs at server side. At server side you need to implement only NFS for the entry in auto.misc.

AT SERVER SIDE:

/etc/exports file:

/home *(rw,sync)


Then start nfs service.
#exportfs -a
#service nfs restart


Now you have done. Check out and tell me what happend?


All times are GMT -5. The time now is 04:06 AM.