Package: nis
Version: 3.15-3
Severity: wishlist
Tags: patch
I am using NIS to centrally maintain a list of users who share a set of
notebooks. Each notebook is setup as a nis slave server, so it knows
about all users in the nis database, even when not connected to the
network.
The problem with a notebook is that it will not always be on the
network. Therefore a user in the nis database needs a home directory
locally on that notebook
The following shell script tries to create home directories for each
user in the database, unless it already exists.
May I suggest to add this script as a part of the NIS utilities?
cat yp-homedir
#! /bin/bash
# create a local home directory for a user in the nis database
# use /etc/skel as a reference
cd /etc/skel
for i in `ypcat passwd|awk -F : '{print $1}'`;
do
home=`ypcat passwd|grep ^$i|awk -F : '{print $6}'`
echo "$i -> $home"
if [ ! -d $home ]; then
echo "creating homedir for nis-user $i in $home"
mkdir -m u=rwx,g=rx,o= $home
chown $i:$i $home
find | cpio -pdv -R $i.$i $home
fi
done
Thanks
Remy
-- Package-specific info:
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-2-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages nis depends on:
ii debconf [debconf-2.0] 1.4.61 Debian configuration management sy
ii libc6 2.3.5-8.1 GNU C Library: Shared libraries an
ii libgdbm3 1.8.3-2 GNU dbm database routines (runtime
ii libslp1 1.2.1-3 OpenSLP libraries
ii make 3.80-11 The GNU version of the "make" util
ii netbase 4.23 Basic TCP/IP networking system
ii portmap 5-16 The RPC portmapper
ii sysvinit 2.86.ds1-6 System-V like init
nis recommends no packages.
-- debconf information excluded
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]