全部博文(21)
分类:
2009-02-27 10:48:46
[簡單做法](但不安全,如有其他user也設定使用/user/bin/false的shell話)
/etc/passwd of /usr/bin/false. THen add /usr/bin/false to /etc/shells.
[安全做法]
1. Create a normal user account (user=xxxx group=none)
2. Make /usr/bin/false as the start-up program
3. The entry in password file should look something like
xxxx:chus5tya:233:20:,,,:/home/xxxx/./:/usr/bin/false
4. Make sure /usr/bin/false is coded in /etc/shells
5. Create the file /etc/ftpd/ftpaccess and put in the following lines ..
class all john,guest
guestgroup none
noretrieve /etc/passwd
6. Perform a man on ftpaccess if you are not sure about the format
7. Perform chmod 444 ftpaccess
# chown bin:bin ftpaccess
8. Edit /etc/inetd.conf & add "-a" argument to ftpd, its illustrated below
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -a
9. # inetd -c
10. Create the following sub-dirs and files
a) ~xxxx/usr
# chown ???R bin:bin usr
# chmod 555 usr
b) ~xxxx/usr/bin
# chown root bin
# chmod 555 bin
# cp -p /sbin/ls ~xxxx/usr/bin/ls