| 首页 | 技术文章 | 软件下载 | 博客 | 论坛 | 精品教程 | 黑客动画 | 视频资源 | 在线服务 | 黑客游戏 | 

您现在的位置: 中国X黑客小组 >> 技术文章 >> 安全防御 >> 网络安全 >> 文章正文 用户登录 新用户注册
  命令行和脚本设置安全用户账户匿名FTP          【字体:
命令行和脚本设置安全用户账户匿名FTP
作者:qsg1982    文章来源:网络    点击数:    更新时间:2007-2-2    

该方案不能用在带有受控的访问保护概要文件(CAPP)和评估保证级别 4+(EAL4+)功能的系统中。












1. 通过输入以下命令验证 bos.net.tcp.client 文件集已安装到您的系统上:

lslpp -L | grep bos.net.tcp.client

如果没有收到输出,则该文件集未安装。

2. 通过输入以下命令验证系统的 /home 目录下是否至少有 8 MB 的可用空间:

df -k /home

步骤4中的脚本需要 /home 目录下至少有 8 MB 可用空间来安装所需的文件和目录。

3. 使用 root 权限,更改为 /usr/samples/tcpip 目录。例如:

cd /usr/samples/tcpip

4. 要设置账户,请运行以下脚本:

./anon.ftp

5. 当提示确定要修改 /home/ftp?时,输入 yes。输出类似于以下显示:

Added user anonymous.

Made /home/ftp/bin directory.

Made /home/ftp/etc directory.

Made /home/ftp/pub directory.

Made /home/ftp/lib directory.

Made /home/ftp/dev/null entry.

Made /home/ftp/usr/lpp/msg/en_US directory.

6. 更改到 /home/ftp 目录。例如:

cd /home/ftp

7. 通过输入以下命令创建 home 子目录:

mkdir home

8. 通过输入以下命令将 /home/ftp/home 目录的许可权更改为 drwxr-xr-x:

chmod 755 home

9. 通过输入以下命令更改到 /home/ftp/etc 目录:

cd /home/ftp/etc

10. 通过输入以下命令创建 objrepos 子目录:

mkdir objrepos

11. 通过输入以下命令将 /home/ftp/etc/objrepos 目录的许可权更改为 drwxrwxr-x:

chmod 775 objrepos

12. 通过输入以下命令将 /home/ftp/etc/objrepos 目录的所有者和组更改为 root 用户和 system 组:

chown root:system objrepos

13. 通过输入以下命令创建 security 子目录:

mkdir security

14. 通过输入以下命令将 /home/ftp/etc/security 目录的许可权更改为 drwxr-x---:

chmod 750 security

15. 通过输入以下命令将 /home/ftp/etc/security 目录的所有者和组更改为 root 用户和 security 组:

chown root:security security

16. 通过输入以下命令更改为 /home/ftp/etc/security 目录:

cd security

17. 通过输入以下 SMIT 快速路径来添加用户:

smit mkuser

在本例中,我们要添加一个名为 test 的用户。

18. 在 SMIT 字段中,输入以下值:

用户名 [test]

管理用户? true

主组 [staff]

组集 [staff]

另一用户可 SU 至用户? true

主目录 [/home/test]

输入更改之后,按下回车键创建用户。在 SMIT 过程完成后,退出 SMIT。

19. 用以下命令为该用户创建密码:

passwd test

当提示时,输入期望的密码。必须再一次输入新密码以确认。

20. 通过输入以下命令更改到 /home/ftp/etc 目录:

cd /home/ftp/etc

21. 通过输入以下命令复制 /etc/passwd 文件到 /home/ftp/etc/passwd 文件:

cp /etc/passwd /home/ftp/etc/passwd

22. 使用您喜欢的编辑器,编辑 /home/ftp/etc/passwd 文件。例如:

vi passwd

23. 从复制的内容中删除除 root、ftp 和 test 用户以外的所有行。编辑之后,内容看起来应该与以下类似:

root:!:0:0::/:/bin/ksh 

ftp:*:226:1::/home/ftp:/usr/bin/ksh 

test:!:228:1::/home/test:/usr/bin/ksh

24. 保存更改并退出编辑器。

25. 通过输入以下命令将 /home/ftp/etc/passwd 文件的许可权更改为 -rw-r--r--:

chmod 644 passwd

26. 通过输入以下命令将 /home/ftp/etc/passwd 目录的所有者和组更改为 root 用户和 security 组:

chown root:security passwd

27. 通过输入以下命令将 /etc/security/passwd 文件内容复制到 /home/ftp/etc/security/passwd 文件:

cp /etc/security/passwd /home/ftp/etc/security/passwd

28. 使用您喜欢的编辑器,编辑 /home/ftp/etc/security/passwd 文件。例如:

vi ./security/passwd

29. 从复制的内容中删去除 test 用户之外的所有节。

30. 从 test 用户节中除去 flags = ADMCHG 行。编辑之后,内容看起来应该与以下类似:

test: 

password = 2HaAYgpDZX3Tw

lastupdate = 990633278

31. 保存更改并退出编辑器。

32. 通过输入以下命令将 /home/ftp/etc/security/passwd 文件的许可权更改为 -rw-------:

chmod 600 ./security/passwd

33. 通过输入以下命令将 /home/ftp/etc/security/passwd 目录的所有者和组更改为 root 用户和 security 组:

chown root:security ./security/passwd

34. 使用您喜欢的编辑器,编辑 /home/ftp/etc/security/group 文件。例如:

vi ./security/group

35. 将以下行添加到文件中:

system:*:0: 

staff:*:1:test

36. 保存更改并退出编辑器,并对/home/ftp/etc/group 文件执行同样的操作。

37. 使用以下命令将相应的内容复制到 /home/ftp/etc/objrepos 目录:

cp /etc/objrepos/CuAt ./objrepos

cp /etc/objrepos/CuAt.vc ./objrepos

cp /etc/objrepos/CuDep ./objrepos

cp /etc/objrepos/CuDv ./objrepos

cp /etc/objrepos/CuDvDr ./objrepos

cp /etc/objrepos/CuVPD ./objrepos

cp /etc/objrepos/Pd* ./objrepos

38. 通过输入以下命令更改到 /home/ftp/home 目录:

cd ../home

39. 通过输入以下命令为您的用户新建一个主目录:

mkdir test

这将是新的 ftp 用户的主目录。

40. 通过输入以下命令将 /home/ftp/home/test 目录的所有者和组更改为 test 用户和 staff 组:

chown test:staff test

41. 通过输入以下命令将 /home/ftp/home/test 文件的许可权更改为 -rwx------:

chmod 700 test

此时,您已经在机器上设置了 ftp 子登录。您可以用以下的过程来测试它。

1. 使用 ftp,连接到您创建 test 用户的主机。例如:

ftp MyHost

2.

[1] [2] 下一页

文章录入:IceRiver    责任编辑:IceRiver 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    用Dos命令加锁 防止病毒格式
    网络攻击常用命令综述
    用Syskey命令加强Windows200
    用Dos命令进行加锁 防止病毒
    巧用命令行 揪出ARP欺骗病毒
    从命令行登陆QQ(QQ密码算法
    小命令大作用 通过Ping排除路
    双剑合一 用Pathping命令诊断
    CourierIMAP XMAILDIR变量远
    Delphi命令行参数
      网友评论:(只显示最新5条。评论内容只代表网友观点,与本站立场无关!)
    Powered by ICE RIVER - STUDIO
    » CnXHacker.CoM   © CopyRight 2002-2006, CnXHacker.CoM™, Inc. All Rights Reserved.