# Diskless users unable to login



## Vizard (Oct 30, 2012)

Hello everyone,


----------



## Vizard (Oct 30, 2012)

Sorry about the above post, It sent and I cannot delete or edit it.

     I have a nfs-root directory that I am pxe-booting off of. It works, but no users other than root are able to log-in. However if I export the directory on the server, I am able to log on as those users. Any suggestions as where to look, or what to do? Thank you.


----------



## AlexJ (Oct 30, 2012)

Did you created passwords for your users in a chrooted directory that is used for diskless machines?
you need to
[cmd=""]# chroot ${NFSROOTDIR}
# passwd
[/cmd]


----------



## Vizard (Oct 30, 2012)

Yes, I did create the users in that directory, and I am able to change their passwords, but not able to login as them. However, I am able to login as the users from the main root directory if I login as root then ssh user@x.x.x.x on the diskless machine.


----------



## redw0lfx (Oct 30, 2012)

Did you look to see if there is any error given in /var/log/auth.log and /var/log/security?  Normally, when a user other than root can't log in, its usually because:

1) User's home directory is not owned by user.
2) Some temporary file can't be written due to permissions
3) If doing diskless booting, user can't read certain files (permissions error).

Let us know if the above log files show any errors as that would narrow down your issue.


----------



## AlexJ (Oct 30, 2012)

You said you can login as root only, so try to login from diskless machine as root and recreate your diskless users from that machine, it should automatically reassign correct permissions if you messed up somewhere on host(NFS server) machine.


----------



## Vizard (Oct 30, 2012)

There appears to be no logs files for my nfs-root directory. In my root directory the log files are there, but it looks like it is look at my root directory, not my nfs-root, though nothing can logon other than root unless I ssh user@x.x.x.x on the diskless machine.

1. Users home is owned by user and I can log in as them when on the server.
2. Possible, they are part of the wheel group though.
3. Possible, but same as above.

Could it be possible it is not looking in the right place for users? Seeing as it still seems to export my / instead of strictly my /nfsroot.


----------



## Vizard (Oct 30, 2012)

All I have really done so far is follow http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-pxe-nfs.html and add the directory conf with settings to mount the nfs-root directory.


----------



## mamalos (Oct 30, 2012)

Are you sure you're exporting/importing the right directory? Because from what you say, it seems that your "client" machine sees the "server" machine's root directory. What are the contents of your "client" machine's /etc/passwd or what do you get when you type:

`# vipw`

on the "client"? Do you see the users you're supposed to?


----------



## AlexJ (Oct 30, 2012)

Lets hope that I'm wrong, but I believe that you're skip something from here:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-diskless.html
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-pxe-nfs.html

Does your ${NFSROOTDIR}/etc/fstab point somewhere to the writable directory for your diskless users?
How did you create users for your diskless machines? YOu need to chroot(8) to a *exported NFS directory* on a NFS server machine and create user's there(include "root"), not on a host/server.

[cmd=""]# cd /b/tftpboot/FreeBSD/install
# chroot
# passwd   # Change password for a diskless ROOT
#...
# adduser  # Add diskless users
#...
# exit
[/cmd]


----------



## Vizard (Oct 30, 2012)

To mamalos,
     When I go to that directory they are there, however when I use that command no users other than root are there.

To AlexJ,
     I did follow both of them both to get it working. It loads the NFS directory, and I did chroot it to add users which are there. I am not sure what I could have skipped, but as mamalos suggested to use vipw no user passwords/users are in there but root.


----------



## Vizard (Oct 30, 2012)

So I was able to log in after redoing 
`# tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc`

Is there any reason as to why? Also it does not load anything in the users profile.


----------



## AlexJ (Oct 30, 2012)

Read CAREFULLY /etc/rc.initdiskless comments in the header as it suggested in the handbook.
There is a bunch of ways how one may create this diskless setup. It just depend on what you want.


----------



## Vizard (Oct 30, 2012)

I tried to set it up the way I used to have it setup with bootp, which was to export the etc folder, but that is not working for some reason. But even then, after the user logs in there is nothing in the profile.


----------

