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

📄 network-ftponly.html

📁 学习linux的工具书
💻 HTML
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
   <meta name="Author" content="Edward Fu">
   <meta name="GENERATOR" content="Mozilla/4.05 [zh-CN] (X11; I; Linux 2.1.127 i686) [Netscape]">
   <title>Freesoft Linux FAQ -- 如何禁止某个用户的telnet功能,同时他有ftp功能?</title>
</head>
<body>
如何禁止某个用户的telnet功能,同时他有ftp功能?
<p>【 在 wavehand (冷血的温柔) 的大作中提到: 】
<br>:&nbsp; 假设你想把用户ftponly的telnet关掉,
<br>:&nbsp; 1)写一个shell script /bin/ftponly:
<br>:&nbsp; #!/bin/sh
<br>:&nbsp; /bin/cat &lt;&lt; XX
<br>:&nbsp; You can only use FTP on this computer,
<br>:&nbsp; but you may not use this account to login.
<br>:&nbsp; Connection will be closed in 10 seconds.
<br>:&nbsp; XX
<br>:&nbsp; /usr/bin/sleep 10
<br>:&nbsp; #end of ftponly
<br>:&nbsp; 2)把用户ftponly的shell设置成/bin/ftponly:
<br>:&nbsp; 到passwd文件,找到对应于ftponly的那行
<br>:&nbsp; ftponly:......:/home/ftponly:/bin/bash,把最后的
<br>:&nbsp; /bin/bash改为/bin/ftponly.
<br>:&nbsp; 3)把 /bin/ftponly 加入到 /etc/shells
<br>:&nbsp; /bin/bash
<br>:&nbsp; /bin/tcsh
<br>:&nbsp; /bin/csh
<br>:&nbsp; /bin/ash
<br>:&nbsp; /bin/zsh
<br>:&nbsp; /bin/ftponly
<br>:&nbsp; 就行了..
<p>--------------
<br>:&nbsp; : 假设你想把用户ftponly的telnet关掉,
<br>:&nbsp; : 1)写一个shell script /bin/ftponly:
<br>:&nbsp; : #!/bin/sh
<br>:&nbsp; : /bin/cat &lt;&lt; XX
<br>&nbsp;
<br>&nbsp;
<br>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
~~
<br>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
XX是随便的一个文件名?
<br>&nbsp;
<br>这里的XX是个标志,当ftponly试图telnet的时候,屏幕上将显示两个XX之间的内容,
<br>然后10秒以后切断connect.
<p>注:还应该用trap来屏蔽键盘中断吧!否则人家用Ctrl-Z......
<br>&nbsp;
<br>&nbsp;
</body>
</html>

⌨️ 快捷键说明

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