⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 386.html

📁 Jsp精华文章合集,JSP方面各种知识介绍
💻 HTML
字号:

<STYLE type=text/css>
<!--
body,td { font-size:9pt;}
hr { color: #000000; height: 1px}
-->
</STYLE>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD><TITLE>精选文章 >> solaris 专栏 >> SUN SOLARIS匿名FTP服务器设置示例</title>
</head>
<body >

<p><IMG SRC="../image/jsp001_middle_logo.gif" WIDTH="180" HEIGHT="60" BORDER=0 ALT=""></p>

<table width=100% bgcolor="#cccccc" align=center cellpadding="2" cellspacing="0" border=1 bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr bgcolor="#EFF8FF"><td>
<a href=http://www.jsp001.com/list_thread.php?int_attribute=2>精选文章</a>
>> <a href=http://www.jsp001.com/list_thread.php?forumid=39&int_attribute=2>solaris 专栏</a>
>> SUN SOLARIS匿名FTP服务器设置示例 [<a href=http://www.jsp001.com/forum/showthread.php?goto=newpost&threadid=386>查看别人的评论</a>]<br>

<hr><p>由 fei 发布于: 2001-02-12 15:06</p><p> </p><p>Example 1: Setting Up An Anonymous Ftp<br><br>SunOS 5.7 Last change: 4 Mar 1997 5<br><br>Maintenance Commands in.ftpd(1M)<br><br>To set up anonymous ftp, add the following entry to the<br>/etc/passwd file. In this example, /export/ftp was chosen to<br>be the anonymous ftp area, and the shell is the non-existent<br>file /nosuchshell. This prevents users from logging in as<br>the ftp user.<br><br>ftp:x:30000:30000:Anonymous FTP:/export/ftp:/nosuchshell<br><br>Add the following entry to the /etc/shadow file:<br><br>ftp:NP:6445::::::<br>ftp:NP:6445::::::<br><br>The following shell script sets up the anonymous ftp area.<br>It presumes that names are resolved using NIS.<br><br>#!/bin/sh<br># script to setup anonymous ftp area<br>#<br><br># verify you are root<br>/usr/bin/id | grep -w 'uid=0' &gt;/dev/null 2&gt;&amp;1<br>if [ "$?" != "0" ]; then<br>echo<br>exit 1<br>fi<br><br># handle the optional command line argument<br>case $# in<br><br># the default location for the anon ftp comes from the <br>passwd file<br>0) ftphome="`getent passwd ftp | cut -d: -f6`"<br>;;<br><br>1) if [ "$1" = "start" ]; then<br>ftphome="`getent passwd ftp | cut -d: -f6`"<br>else<br>ftphome=$1<br>fi<br>;;<br><br>*) echo "Usage: $0 [anon-ftp-root]"<br>exit 1<br>;;<br>esac<br><br>if [ -z "${ftphome}" ]; then<br>echo "$0: ftphome must be non-null"<br>exit 2<br>fi<br><br>case ${ftphome} in<br>/*) # ok<br><br>;;<br><br>*) echo "$0: ftphome must be an absolute pathname"<br>exit 1<br>;;<br>esac<br><br># This script assumes that ftphome is neither / nor /usr so <br>...<br>if [ -z "${ftphome}" -o "${ftphome}" = "/" -o "${ftphome}" = <br>"/usr" ];<br>then<br>echo "$0: ftphome must be non-null and neither / or /usr"<br>exit 2<br>fi<br><br># If ftphome does not exist but parent does, create ftphome<br>if [ ! -d ${ftphome} ]; then<br># lack of -p below is intentional<br>mkdir ${ftphome}<br>fi<br>chown root ${ftphome}<br>chmod 555 ${ftphome}<br><br>echo Setting up anonymous ftp area ${ftphome}<br><br># Ensure that the /usr directory exists<br>if [ ! -d ${ftphome}/usr ]; then<br>mkdir -p ${ftphome}/usr<br>fi<br># Now set the ownership and modes to match the man page<br>chown root ${ftphome}/usr<br>chmod 555 ${ftphome}/usr<br><br># Ensure that the /usr/bin directory exists<br>if [ ! -d ${ftphome}/usr/bin ]; then<br>mkdir -p ${ftphome}/usr/bin<br>fi<br># Now set the ownership and modes to match the man page<br>chown root ${ftphome}/usr/bin<br>chmod 555 ${ftphome}/usr/bin<br><br># this may not be the right thing to do<br># but we need the bin -&gt; usr/bin link<br>rm -f ${ftphome}/bin<br>ln -s usr/bin ${ftphome}/bin<br><br># Ensure that the /usr/lib and /etc directories exist<br>if [ ! -d ${ftphome}/usr/lib ]; then<br>mkdir -p ${ftphome}/usr/lib<br>fi<br>chown root ${ftphome}/usr/lib<br>chmod 555 ${ftphome}/usr/lib<br><br>if [ ! -d ${ftphome}/usr/lib/security ]; then<br><br>mkdir -p ${ftphome}/usr/lib/security<br>fi<br>chown root ${ftphome}/usr/lib/security<br>chmod 555 ${ftphome}/usr/lib/security<br><br>if [ ! -d ${ftphome}/etc ]; then<br>mkdir -p ${ftphome}/etc<br>fi<br>chown root ${ftphome}/etc<br>chmod 555 ${ftphome}/etc<br># a list of all the commands that should be copied to <br>${ftphome}/usr/b<br>in<br># /usr/bin/ls is needed at a minimum.<br>ftpcmd="<br>/usr/bin/ls<br>"<br><br># ${ftphome}/usr/lib needs to have all the libraries needed <br>by the abo<br>ve<br># commands, plus the runtime linker, and some name service <br>libraries<br><br># to resolve names. We just take all of them here.<br><br>ftplib="`ldd $ftpcmd | nawk '$3 ~ /lib/ { print $3 }' | sort <br>| uniq`"<br>ftplib="$ftplib /usr/lib/nss_* /usr/lib/straddr* <br>/usr/lib/libmp.so*"<br>ftplib="$ftplib /usr/lib/libnsl.so.1 /usr/lib/libsocket.so.1 <br>/usr/lib/<br>ld.so.1"<br>ftplib="`echo $ftplib | tr ' ' '\n' | sort | uniq`"<br><br>cp ${ftplib} ${ftphome}/usr/lib<br>chmod 555 ${ftphome}/usr/lib/*<br><br>cp /usr/lib/security/* ${ftphome}/usr/lib/security<br>chmod 555 ${ftphome}/usr/lib/security/*<br><br>cp ${ftpcmd} ${ftphome}/usr/bin<br>chmod 111 ${ftphome}/usr/bin/*<br><br># you also might want to have separate minimal versions of <br>passwd and<br>group<br>cp /etc/passwd /etc/group /etc/netconfig /etc/pam.conf <br>${ftphome}/etc<br>chmod 444 ${ftphome}/etc/*<br><br># need /etc/default/init for timezone to be correct<br>if [ ! -d ${ftphome}/etc/default ]; then<br>mkdir ${ftphome}/etc/default<br>fi<br>chown root ${ftphome}/etc/default<br>chmod 555 ${ftphome}/etc/default<br>cp /etc/default/init ${ftphome}/etc/default<br>chmod 444 ${ftphome}/etc/default/init<br><br># Copy timezone database<br>mkdir -p ${ftphome}/usr/share/lib/zoneinfo<br><br>(cd ${ftphome}/usr/share/lib/zoneinfo<br>(cd /usr/share/lib/zoneinfo; find . -print |<br>cpio -o) 2&gt;/dev/null | cpio -imdu 2&gt;/dev/null<br>find . -print | xargs chmod 555<br>find . -print | xargs chown root<br>)<br><br># Ensure that the /dev directory exists<br>if [ ! -d ${ftphome}/dev ]; then<br>mkdir -p ${ftphome}/dev<br>fi<br><br># make device nodes. ticotsord and udp are necessary for<br># 'ls' to resolve NIS names.<br><br>for device in zero tcp udp ticotsord ticlts<br>do<br>line=`ls -lL /dev/${device} | sed -e 's/,//'`<br>major=`echo $line | awk '{print $5}'`<br>minor=`echo $line | awk '{print $6}'`<br>rm -f ${ftphome}/dev/${device}<br>mknod ${ftphome}/dev/${device} c ${major} ${minor}<br>done<br><br>chmod 666 ${ftphome}/dev/*<br><br>## Now set the ownership and modes<br>chown root ${ftphome}/dev<br>chmod 555 ${ftphome}/dev<br><br># uncomment the below if you want a place for people to store <br>things,<br># but beware the security implications<br>#if [ ! -d ${ftphome}/pub ]; then<br># mkdir -p ${ftphome}/pub<br>#fi<br>#chown root ${ftphome}/pub<br>#chmod 1755 ${ftphome}/pub<br><br>After running this script, edit the files in ~ftp/etc to<br>make sure all non-public information is removed.<br></p></td>
  </tr>
</table>

<p>
<CENTER><a href="http://www.jsp001.com/forum/newreply.php?action=newreply&threadid=386">点这里对该文章发表评论</a></CENTER>
<p>该文章总得分是 <font color=red>0</font> 分,你认为它对你有帮助吗?
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=386&intVote=4","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>非常多</a>](<font color=red>0</font>) 
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=386&intVote=2","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>有一些</a>](<font color=red>0</font>) 
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=386&intVote=1","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>无帮助</a>](<font color=red>0</font>) 
				[<a href=javascript:void(0) onclick=window.open("http://www.jsp001.com/forum/codeVote.php?threadid=386&intVote=-1","","menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width=70,height=40,top=0,left=0")>是灌水</a>](<font color=red>0</font>) </p>
<script language="javascript" src="http://www.jsp001.com/include/read_thread_script.php?threadid=386"></script>
<p><CENTER>
Copyright &copy; 2001 - 2009 JSP001.com . All Rights Reserved <P>

<IMG SRC="../image/jsp001_small_logo.gif" WIDTH="85" HEIGHT="30" BORDER=0 ALT="">
</CENTER></p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -