Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 1175 9128960 83 Linux
/dev/sda3 1175 1306 1048576 82 Linux swap / Solaris
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
quotacheck: Scanning /dev/sdb1 [/mnt/part1] done
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Old group file not found. Usage will not be substracted.
quotacheck: Checked 3 directories and 2 files
quotacheck: Old file not found.
[root@localhost part1]# ll
total 19
-rw-------. 1 root root 6144 Feb 15 03:18 aquota.user
drwx------. 2 root root 12288 Feb 15 01:29 lost+found
[root@localhost part1]# useradd user1
[root@localhost part1]# passwd user1
Changing password for user user1.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# edquato -u user1
[root@localhost part1]# useradd user2
[root@localhost part1]# passwd user2
Changing password for user user2.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost part1]# edquota -p user1 -u user2
[root@localhost part1]# edquota -u user2
[root@localhost part1]# vim /etc/vsftpd/vsftpd.conf
改为如图内容
[root@localhost part1]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@localhost part1]# cd ./public/
[root@localhost public]# touch f1.txt
[root@localhost public]# touch f2.txt
[root@localhost public]# setenforce 0
[root@localhost public]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@localhost public]# vim /etc/vsftpd/vsftpd.conf
[root@localhost public]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@localhost public]# dd if=/dev/zero of=f3 bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0178166 s, 58.9 MB/s
[root@localhost public]# mv f3 ../home/user1
[root@localhost public]# cd /tmp
[root@localhost tmp]# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 (vsFTPd 2.2.2)
Name (127.0.0.1:root): user1
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (127,0,0,1,127,184).
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 1048576 Feb 16 02:09 f3
226 Directory send OK.
ftp> get f3
local: f3 remote: f3
227 Entering Passive Mode (127,0,0,1,116,177).
150 Opening BINARY mode data connection for f3 (1048576 bytes).
226 Transfer complete.
1048576 bytes received in 0.998 secs (1050.89 Kbytes/sec)
[root@localhost public]# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 (vsFTPd 2.2.2)
Name (127.0.0.1:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> get f3
local: f3 remote: f3
227 Entering Passive Mode (127,0,0,1,149,174).
150 Opening BINARY mode data connection for f3 (131072 bytes).
226 Transfer complete.
131072 bytes received in 0.656 secs (109.79 Kbytes/sec)
最大连接数测试(3)如图
[root@localhost public]# vim /etc/vsftpd/vsftpd.conf
[root@localhost public]# service vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
每个ip的最大连接数测试(2)如下
[root@localhost public]# ftp 192.168.2.199
Connected to 192.168.2.199 (192.168.2.199).
421 There are too many connections from your internet address.
ftp> bye
支持配置目录的概念(针对每一个用户),在里面的针对用户的配置,将覆盖先前的系统配置,如annoymous
[root@localhost public]# cd /etc/vsftpd/
[root@localhost vsftpd]# mkdir dir
[root@localhost vsftpd]# vim ./dir
[root@localhost vsftpd]# cd ./dir
[root@localhost dir]# vim user1
[root@localhost dir]# vim user2
[root@localhost tmp]# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 (vsFTPd 2.2.2)
Name (127.0.0.1:root): user2
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (127,0,0,1,146,163).
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 131072 Feb 16 05:04 f3
226 Directory send OK.
ftp> get f3
local: f3 remote: f3
227 Entering Passive Mode (127,0,0,1,147,100).
150 Opening BINARY mode data connection for f3 (131072 bytes).
226 Transfer complete.
131072 bytes received in 33.4 secs (3.93 Kbytes/sec)
ftp> bye
[root@localhost tmp]# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 (vsFTPd 2.2.2)
Name (127.0.0.1:root): user2
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (127,0,0,1,183,105).
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 131072 Feb 16 05:04 f3
226 Directory send OK.
ftp> get f3
local: f3 remote: f3
227 Entering Passive Mode (127,0,0,1,173,103).
150 Opening BINARY mode data connection for f3 (131072 bytes).
226 Transfer complete.
131072 bytes received in 0.0655 secs (2000.89 Kbytes/sec)
ftp> bye