- 论坛徽章:
- 0
|
FTP设置
配置ftp(系统自带)
引用:
# ee /etc/inetd.conf
复制内容到剪贴板
代码:
ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l -h
//去掉ftp前的#号
引用:
# ee /etc/rc.conf
复制内容到剪贴板
代码:
inetd_enable="YES"
启动ftp
引用:
# killall -HUP inetd
添加ftp用户组
引用:
# pw groupadd ftpgroup -g 10001
添加ftp用户
引用:
# adduser
Username:ftp
Full name:
Uid (Leave empty for default):1001
Login group [ftpuser]: ftpgroup
Login group is ftpgrou. Invite ftpuser into other groups? []:
Login class [default]:
Shell (sh csh tcsh zsh nologin) [sh]:
Home directory [/home/ftpuser]:/usr/www
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username : ftpuser
Password : *****
Full Name :
Uid : 1001
Class :
Groups : ftpgroup
Home : /usr/www
Shell : /bin/sh
Locked : no
OK? (yes/no) : yes
adduser: INFO: Successfully added (ftpuser) to the user database.
Add another user? (yes/no): no
Goodbye!
禁止匿名用户登录
引用:
# ee /etc/ftpusers
复制内容到剪贴板
代码:
anonymous
@guest
设定用户使用目录
引用:
# ee /etc/ftpchroot
复制内容到剪贴板
代码:
ftpusr /usr/www
设置用户磁盘限额
引用:
# ee /etc/rc.conf
复制内容到剪贴板
代码:
enable_quotas="YES"
check_quotas="YES"
引用:
# ee /etc/fstab
复制内容到剪贴板
代码:
/dev/ad0s1f /usr ufs rw,userquota,groupquota 2 2
引用:
# quotacheck -av
# repquota –a
# edquota –u ftpuser
复制内容到剪贴板
代码:
/usr: kbytes in use: 0, limits (soft = 100000, hard = 100020) # soft是警告容量,hard是强制容量
引用:
# edquota –t
复制内容到剪贴板
代码:
/usr: block grace period: 1 minutes, file grace period: 1 minutes
引用:
# quotaon -a |
|