My Opera is closing 1st of March

M.I.T = Multimedia IT dept.

Subscribe to RSS feed

add many FTP users via script in OpenBSD

, , ,

#!/bin/sh
# The format is username:password:shell:homedir:groupname
# Set their homedirs to existing folders and chroot them!!!

cat $1 | while read LINE
do

NAME=`echo $LINE | cut -f1 -d :`
PASS=`echo $LINE | cut -f2 -d :`
SHEL=`echo $LINE | cut -f3 -d :`
DIRC=`echo $LINE | cut -f4 -d :`
GRUP=`echo $LINE | cut -f5 -d :`
HASH=`encrypt -b 6 $PASS`
GPID=`cat /etc/group | grep $GRUP | cut -f3 -d :`

#useradd -m -d /home/$NAME -p $HASH $NAME
useradd -s $SHEL -d $DIRC -g $GPID -p $HASH $NAME
echo $NAME >> /etc/ftpchroot

done
February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28