免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6141 | 回复: 9
打印 上一主题 下一主题

Solaris8 ftp用户权限的问题 ----Can someone give me some good advice,thanks !!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-14 15:40 |只看该作者 |倒序浏览
目前的需求是:在现有的Solaris 8的环境下,新增一个ftp用户,但是这个用户只能ftp登录,不能telnet,ftp登录后只能在它的家目录,不能浏览或进入其他目录。

我知道在Solaris 9的环境下可以很方便的去设置,有谁曾经在Solaris8的环境下有实现过这个功能,请说一下你的解决方案,谢谢

[ 本帖最后由 lalf 于 2007-7-15 22:35 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-07-15 22:37 |只看该作者
顶一下,希望有高手可以帮忙,谢谢!!!

论坛徽章:
0
3 [报告]
发表于 2007-07-16 08:33 |只看该作者

论坛徽章:
0
4 [报告]
发表于 2007-07-16 08:45 |只看该作者
想知道你在solrais9下怎么实现的

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-03-19 06:20:00数据库技术版块每日发帖之星
日期:2016-07-05 06:20:00
5 [报告]
发表于 2007-07-16 08:57 |只看该作者
你可以man ftpd,在Solaris 8下系统不带你所要求的FTP SERVER,如要实现你说的功能,需要自己去下载一个第三方的FTP SERVER.

论坛徽章:
0
6 [报告]
发表于 2007-07-16 11:06 |只看该作者
其实不是我的方案,下面是我一个同事提出的在9环境下的solution。我也没试过,不过觉得应该是没问题
1) mkdir /export/home/guests
2)Check whether the file /usr/bin/ftponly exists, if it does go to step 5
3)cp /usr/bin/true /usr/bin/ftponly
4)chmod 755 /usr/bin/ftponly
5)Ensure /bin/ftponly is listed in /etc/shells
6)Add FTP account for new user: /usr/sbin/useradd –m –c “new user” –d /export/home/guests/./new1 –s /bin/ftponly new1
7)Add the line: guestuser new1 to /etc/ftpd/ftpaccess using vi
Ensure that root is listed in /etc/ftpd/ftpusers so that root is denied ftp access
9)Create FTP root area using: /usr/sbin/ftpconfig –d /export/home/guests

论坛徽章:
0
7 [报告]
发表于 2007-07-16 11:10 |只看该作者

回复 #5 bencyber 的帖子

请问一下你用的是哪一版的FTP,可以建议一下吗?要可以满足到我要求的,谢谢 !!!

论坛徽章:
0
8 [报告]
发表于 2007-07-16 14:16 |只看该作者
怎么没人帮忙啊~~~
还是说我写的不够清楚--- 很少发贴,没什么经验,请多多包涵~~

论坛徽章:
0
9 [报告]
发表于 2007-07-16 16:59 |只看该作者
Solaris自带的FTP服务器是: WU-ftp

   默认情况下,solaris开通ftp及telnet,这两项服务均由inetd控制,其配置文件为/etc/inetd.conf,可注销掉相应的行对此服务进行开放或禁止,然后重启inetd进程立刻生效!
  solaris 8 ftp配置文件,默认放置在/etc下;从solaris 9开始,ftp配置放置在/etc/ftpd下,而且安装好OS后,服务均默认开放!下面以solaris 9为例,介绍常见的两个问题:

1.若要限制root用户ftp权限,只需修改/etc/ftpd/ftpusers,注销掉root行!  

2.若要让ftp用户登陆后限制在自己当前目录下活动,可编辑/etc/ftpd/ftpaccess,加入如下一行:
restricted-uid userid

如:
restricted-uid  abc  tom  ericsson


  
3.若要禁止ftp用户以telnet登陆到本系统中,可编辑/etc/shells,加入你要指定的shell,,当然此shell可以是一个空的不存在的shell,这样做只是为了让系统认为其合法,从而在实现此功能的前掉下不影响ftp功能!
#more /etc/shells
/usr/bin/bash
/bin/sh
/usr/lib/uucp/uucico
/bin/csh
/bin/ksh
/bin/tcsh
/sbin/sh
/bin/sh
/sbin/nologin

#more /etc/passwd
abc:x:107:1::/var/abc:/sbin/nologin
tom:x:108:1::/var/tom:/sbin/nologin
ericsson:x:109:1::/var/ericsson:/sbin/nologin

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
10 [报告]
发表于 2007-07-16 17:08 |只看该作者
建立匿名ftp即可。Solaris 8下man ftpd中有详细的步骤:

Example (Solaris 8): Setting Up An Anonymous Ftp

To set up anonymous ftp, add the following entry to the /etc/passwd file. In this example, /export/ftp was chosen to be the anonymous ftp area, and the shell is the non-existent file /nosuchshell. This prevents users from logging in as the ftp user.

     ftp:30000:30000:Anonymous FTP:/export/ftp:/nosuchshell

Add the following entry to the /etc/shadow file:

     ftp:NP:6445::::::

The banner returned by in.ftpd in the parenthetical portion of its greeting is configurable. The default is equivalent to "`uname -sr`" and will be used if no banner is set in /etc/default/ftpd. To set the banner, add a line of the form
     BANNER="..."

to /etc/default/ftpd. Nonempty banner strings are fed to shells for evaluation.
The default banner may also be obtained by
     BANNER="`uname -s` `uname -r`"

and no banner will be printed if /etc/default/ftpd contains
     BANNER="

For anonymous ftp users, in.ftpd takes special measures to restrict the client's access privileges. The server performs a chroot(2) command to the home directory of the "ftp" user. In order that system security is not breached, it is recommended that the "ftp" subtree be constructed with care; the following rules are suggested.

     ~ftp  Make the home directory owned by root and unwritable by anyone.

     ~ftp/bin
Make this directory owned by the superuser and unwritable by anyone. Make this a symbolic link to ~ftp/usr/bin The program ls(1) must be present to support the list commands. This program should have mode 111.

     ~ftp/usr/lib
Make this directory owned by the superuser and unwritable by anyone. Copy the following shared libraries from /usr/lib into this directory:
ld.so.1*
libc.so.1*
libdl.so.1*
libmp.so.2*
libnsl.so.1*
libsocket.so.1*
nss_compat.so.1*
nss_dns.so.1*
nss_files.so.1*
nss_nis.so.1*
nss_nisplus.so.1*
nss_xfn.so.1*
straddr.so*
straddr.so.2*

     ~ftp/etc
Make this directory owned by the superuser and unwritable by anyone. Copies of the files  passwd(4), group(4), and netconfig(4) must be present for the ls(1) command to work properly. These files should be mode 444.

     ~ftp/pub
Make this directory mode 755 and owned by root. Users should then place files which are to be accessible via the anonymous account in this directory.

     ~ftp/dev
Make this directory owned by the superuser and unwritable by anyone. First perform ls -lL on the device files listed below to determine their major and minor numbers, then use mknod to create them in this directory.

/dev/zero
/dev/tcp
/dev/udp
/dev/ticotsord

Set the read and write mode on these nodes to 666 so that passive ftp will not fail with "permission denied" errors.

     ~ftp/usr/share/lib/zoneinfo
Make this directory mode 555 and owned by the superuser. Copy its contents from  /usr/share/lib/zoneinfo. This enables ls -l to display time and date stamps correctly.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP