Solaris 建立 Anonymous FTP Server( 二 )


mkdir ${ftphome}/etc/default
fi
chown root ${ftphome}/etc/default
chmod 555 ${ftphome}/etc/default
cp /etc/default/init ${ftphome}/etc/default
chmod 444 ${ftphome}/etc/default/init

# Copy timezone database
mkdir -p ${ftphome}/usr/share/lib/zoneinfo
(cd ${ftphome}/usr/share/lib/zoneinfo
(cd /usr/share/lib/zoneinfo; find . -print |
cpio -o) 2>/dev/null | cpio -imdu 2>/dev/null
find . -print | xargs chmod 555
find . -print | xargs chown root
)

# Ensure that the /dev directory exists
if [ ! -d ${ftphome}/dev ]; then
mkdir -p ${ftphome}/dev
fi

# make device nodes. ticotsord and udp are necessary for
# "ls" to resolve NIS names.

for device in zero tcp udp ticotsord ticlts
do
line=`ls -lL /dev/${device} | sed -e "s/,//"`
major=`echo $line | awk "{print $5}"`
minor=`echo $line | awk "{print $6}"`
rm -f ${ftphome}/dev/${device}
mknod ${ftphome}/dev/${device} c ${major} ${minor}
done

chmod 666 ${ftphome}/dev/*

## Now set the ownership and modes
chown root ${ftphome}/dev
chmod 555 ${ftphome}/dev

# uncomment the below if you want a place for people to store things,
# but beware the security implications
#if [ ! -d ${ftphome}/pub ]; then
# mkdir -p ${ftphome}/pub
#fi
#chown root ${ftphome}/pub
#chmod 1755 ${ftphome}/pub


# chmod 755 /etc/ftpanonymous
# /etc/ftpanonymous ( 执行ftpanonymous )
# cd ~ftp/etc <--- 检查有没有不能公开的文档

完成

推荐阅读