Since we are going to use Dos based utility, uimport, this operation can only be done one context at a time (I think).
For this example we will suppose that we want to assign unique Unix IDS to all members of context GCP.PC.
- Get a list of all users of this context one per line using any Dos based utility or use ncplist from a Linux box:
(ncplist is in ncpfs/contrib/tcl-utils that is not installed by default, so cd there && make && make install).
ncplist -o GCP.PC -l user -Q -v 4 -c GCP.PC -A |sort >linuxgcp.txt
-o context to scan
-l class to scan (user)
-Q quiet, only user's CN
-v 4 use typeless names
-c GCP.PC use this a default context
-A do abbreviate typeless names
You should get a list like this one:
atoumine
cbignon
ccarton
csubai
ctouboulic
...
- Decide what sequence of Unix UIDS you plan to assign them, say starting at 2000. and where will be the homes, say
on a NFS remote server locally automounted as /nfs/home, finally to make things easier we add then to a NDS group say linuxok.pc
- open the text file linuxgcp.txt with a spreadsheet and remove any 'unwanted user'.
- using the incremental copying feature create a second colomn with
number 2000,2001... down to the last user.
- In first cell of column 3 use the formula =concat("U:";A2) and copy down the column
- In first cell of column 4 use the formula =concat("H:/nfs/home/";/A1) and copy down the column
- Fill all column 5 with the group name linuxok.pc
- save as a CSV file (strings surrounded by quotes, comma separated) as linuxgcp.csv
- You should get something like :
"atoumine",2000,"U:2000","H:/nfs/home/atoumine","linuxok.pc"
"cbignon",2001,"U:2001","H:/nfs/home/cbignon","linuxok.pc"
"ccarton",2002,"U:2002","H:/nfs/home/ccarton","linuxok.pc"
"csubai",2003,"U:2003","H:/nfs/home/csubai","linuxok.pc"
"ctouboulic",2004,"U:2004","H:/nfs/home/ctouboulic","linuxok.pc"
...
- Now from a Dos workstation prepare the following control file for uimport, says linuxgcp.ctl
(argh, my uimport wants french headings !)
;linuxgcp.ctl
CONTROLE IMPORTATION
MODE D'IMPORTATION=U <-- update
CONTEXTE DE NOM="gcp.pc" <-- set to the target context
SEPARATEUR=, <-- comma is separator, can be changed
LIBELLE=" <-- quotes around strings
REMPLACER LA VALEUR=N <- DO NOT replace values !!!
NBRE DE REESSAIS DE REPERTOIRE MAX=5
FIELDS
Name
Skip
Location
Location
Group MemberShip
- make a test data file with the first two lines of the linuxgcp.cvs -> test.cvs
- Give it a go by uimport linuxgcp.ctl test.cvs
- Check with NWADmin that everything is OK. The 2 first users should have two extra Location strings (U:2000 and H:/nfs/home/atoumine...)
and be members of group LinuxOK.PC
- Remove the two first lines of the real data file and run uimport linuxgcp.ctl linuxgcp.cvs....
- That's it. Your NDS Unix properties are set.
- Now your users should be authenticated with their login/password on a linux box with the following settings in
/etc/pam.d/system-auth
# adapt server, list of contexts and control group names
#use -d to see what happened in /var/log/secure
auth sufficient pam_unix.so .....
auth required pam_ncp_auth.so -d -u,,r,gcds ndsserver=myserver:GCP.PC/LinuxOK.PC
...
session optional pam_ncp_auth.so
and a local dummy directory /nfs/home in which homes will be autocreated
- What's left to be done ?
- using the pam snapin (or in the pam_ncp_auth command line, set some nice zenflags such as -zA (automount Netware home)
- Set up a NFS server for homes
- Set up NFS mounting on workstations (either in /etc/fstab or using autofs but name must be /nfs/home)).
- Run on the ncpfs enabled NFS server the synchronization script with the -F option.
This will create a /tmp/ndsfixlinuxok.pc.sh script that you can run to setup all homes (creation, permissions
and initial copy of some files from /etc/skel).
- Destroy the /nfs/home on test workstations.
- add -l -n to the pam_ncp_auth command line to force it not to create homes and automount Netware home locally.
- Use the pam snapin to set 'Next Unix Id' to use when manually adding users with NWAdmin
to one plus the last number you have assigned here.
- take care of NDS to Unix groups synchronization.
have fun ;-)
|