Solved Setting password on diskless client

In an attempt to set the password on a diskless client, I thought that if I ran passwd after chrooting to appropriate location on the NFS server from which the client boots then I could set the password... unfortunately i get:-
Code:
root@tester:/etc # passwd
Changing local password for root
New Password:
Retype New Password:
passwd: could not lock the passwd file: : Operation not supported
Any suggestions as to why this happens or how I should go about it.
 
Code:
root@tester:/ # ls -al /tmp
total 11
drwxrwxrwt   6 root  wheel   6 Jul 11 21:57 .
drwxr-xr-x  18 root  wheel  25 Jul 11 21:56 ..
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .ICE-unix
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .X11-unix
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .XIM-unix
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .font-unix
root@tester:/ # touch /tmp/a-file
root@tester:/ # ls -al /tmp
total 20
drwxrwxrwt   6 root  wheel   7 Jul 11 21:58 .
drwxr-xr-x  18 root  wheel  25 Jul 11 21:56 ..
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .ICE-unix
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .X11-unix
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .XIM-unix
drwxrwxrwt   2 root  wheel   2 Mar 18 16:35 .font-unix
-rw-r--r--   1 root  wheel   0 Jul 11 21:58 a-file
 
A: A directory listing does not answer the question whether the whole /etc/ file system is readonly; it only answers the question whether the permissions of the file would allow writes if the file system were mounted normal (read-write).

B: Read the error message carefully: "could not lock the passwd file: Operation not supported". So what happened is that the program passwd tried to lock the file (for example with the flock() system call), and got an error from the file system implementation that this operation is not supported. In your particular case, the file system is NFS. Do you know that in order to use locking over NFS, you also need to run the locking daemon lockd on the server, in addition to the standard nfsd and mountd daemons? And I vaguely remember that configuring locking over NFS can be somewhat non-trivial if different OSes are involved.
 
Thanks for the suggestion that the problem might be NFS related. To check, I sshed into the NFS server, chrooted to the same directory and ran passwd and it worked!

I'm sure documentation for setting passwords on a diskless client must exist somewhere, but I couldn't find it.
 
Back
Top