MILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">目前很多企业单位正在构架自己的Intr.net,FTP服务器是其中的一个服务支持,有很多单位购置了基于UNIX平台的计算机,为了在网上能够提供FTP服务支持,专门购置基于UNIX平台的FTP Server软件,其实在基于UNIX平台的计算机系统中,采取一定的技术方法,就可以建立自己的FTP Server,实现网上文件上下载服务,无须再购置专门的软件,和乐而不为之呢?下面就其建立过程阐述如下: 1. 确定FTP Server的共享目录 为FTP Server建立一个FTP工作目录,在此设定为/home/ftp 2. 编写FTP Server初始设置的Shell程序(setup) 用编辑工具(如vi)编写一个Shell程序,用于对系统进行设置。 #!/bin/sh case $# in 0) ftphome="`grep '^ftp:' /etc/passwd | cut -d: -f6`" ;; 1) if [ "$1" = "start" ]; then ftphome="`grep '^ftp:' /etc/passwd | cut -d: -f6`" else ftphome=$1 fi ;; *) echo "Usage: $0 [anon-ftp-root]" exit 1 ;; esac if [ -z "${ftphome}" ]; then echo "$0: ftphome must be non-null" exit 2 fi if [ "${ftphome}" = "/" -o "${ftphome}" = "/usr" ]; then echo "$0: ftphome must not be / or /usr" exit 2 fi if [ ! -d ${ftphome} ]; then mkdir ${ftphome} fi if [ ! -d ${ftphome}/usr/bin ]; then mkdir -p ${ftphome}/usr/bin fi cp /usr/bin/ls ${ftphome}/usr/bin chmod 111 ${ftphome}/usr/bin/ls chown root ${ftphome}/usr/bin chmod 555 ${ftphome}/usr/bin if [ -r ${ftphome}/bin ]; then mv -f ${ftphome}/bin ${ftphome}/Obin fi ln -s usr/bin ${ftphome} if [ ! -d ${ftphome}/usr/lib ]; then mkdir -p ${ftphome}/usr/lib fi if [ ! -d ${ftphome}/etc ]; then mkdir -p ${ftphome}/etc fi cp /usr/lib/ld.so /usr/lib/ld.so.1 ${ftphome}/usr/lib for lib in libc libdl libintl libw libnsl libsocket \ nss_nis nss_nisplus nss_dns nss_files do cp /usr/lib/${lib}.so.1 ${ftphome}/usr/lib rm -f ${ftphome}/usr/lib/${lib}.so ln -s ./${lib}.so.1 ${ftphome}/usr/lib/${lib}.so done
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073










