理论+实操:FTP服务详细介绍优化,创建虚拟用户

搭建FTP服务

一 :安装ftp服务

1.1 挂载镜像文件


安装vsftpd软件包

1.2 也可以使用yum仓库

[[email protected] ~]# yum install vsftpd-sysvinit.x86_64  -y
Installed:
  vsftpd-sysvinit.x86_64 0:3.0.2-25.el7                                  

Complete!

1.3 相关文件路径

[[email protected] ~]# cd /etc/vsftpd/
[[email protected] vsftpd]# ls
ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh

vsftpd.conf 配置文件

user_list 用户列表 ,通过修改配置文件去决定用户列表中的用户是否可以登录,即修改黑白名单的登录权限

  • 默认的配置文件参数如下
[[email protected] vsftpd]# grep -v ‘#‘ vsftpd.conf  ‘过滤出有效的执行参数‘
anonymous_enable=YES        ‘启用匿名用户‘
local_enable=YES        ‘启用本地用户‘
write_enable=YES        ‘启用写入权限‘
local_umask=022         ‘启用反掩码‘
dirmessage_enable=YES   ‘‘
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES

pam_service_name=vsftpd     ‘pam模块认证‘
userlist_enable=YES         ‘用户列表开启‘
tcp_wrappers=YES

这个时候不做修改其实也可以用

[[email protected] vsftpd]# systemctl start vsftpd
[[email protected] vsftpd]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-12-07 14:35:44 CST; 22s ago
  Process: 93638 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 93639 (vsftpd)
   CGroup: /system.slice/vsftpd.service
           └─93639 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

Dec 07 14:35:44 localhost.localdomain systemd[1]: Starting Vsftpd ftp ...
Dec 07 14:35:44 localhost.localdomain systemd[1]: Started Vsftpd ftp d...
Hint: Some lines were ellipsized, use -l to show in full.

二 : 优化ftp服务

2.1 需要注意的就是要关闭防火墙,还有setenforce

[[email protected] vsftpd]# systemctl stop firewalld.service
[[email protected] vsftpd]# setenforce 0
[[email protected] vsftpd]# 

2.1.1 使用另一台主机,去登陆ftp服务器,使用匿名登陆的方式

C:\Users\GSY>ftp 192.168.247.140    ‘开启vsftpd的服务器ip‘
连接到 192.168.247.140。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.140:(none)): ftp
331 Please specify the password.
密码:
230 Login successful.
ftp>
ftp> pwd    ‘查看所在位置‘
257 "/"     ‘这里的根不代表服务器的根目录,代表vsftpd的站点‘
ftp> ls -a      ‘查看‘
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
.
..
centos7
ks.cfg
pub     ‘公共文件夹‘
226 Directory send OK.
ftp: 收到 32 字节,用时 0.00秒 16.00千字节/秒。
ftp>

可以到服务器的相应站点去查看

[[email protected] vsftpd]# ls -a /var/ftp
.  ..  centos7  ks.cfg  pub

在服务器上创建一个文件去测试

[[email protected] vsftpd]# echo "778899" > /var/ftp/test.txt
[[email protected] vsftpd]# ls -a /var/ftp
.  ..  centos7  ks.cfg  pub  test.txt
[[email protected] vsftpd]# cat /var/ftp/test.txt
778899

去客户机查看

ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
centos7
ks.cfg
pub
test.txt        ‘增加对应的文件‘
226 Directory send OK.
ftp: 收到 35 字节,用时 0.01秒 7.00千字节/秒。
ftp>

2.2 客户机切换到e盘去进行下载测试

ftp> get test.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for test.txt (7 bytes).
226 Transfer complete.
ftp: 收到 7 字节,用时 0.00秒 7000.00千字节/秒。
ftp>

测试完下载,然后测试上传

反馈权限不够

ftp> put 999.txt
200 PORT command successful. Consider using PASV.
550 Permission denied.
ftp>

2.3 现在去修改服务器的vsftpd配置文件,使匿名登陆的权限最大化

#anon_mkdir_write_enable=YES        ‘代表匿名用户可以创建目录‘
#anon_upload_enable=YES         ‘代表匿名用户可以上传‘

将#号键去掉,保存退出

还可以使用man 去查看vsftpd.conf配置文件的用法

[[email protected] vsftpd]# man vsftpd.conf

进入man模式,:anon去查看关键信息

          Default: NO

   anon_other_write_enable
          If  set to YES, anonymous users will be permitted to per‐
          form write operations other than upload and create direc‐
          tory,  such  as  deletion and renaming. This is generally
          not recommended but included for completeness.

          Default: NO

   anon_upload_enable
          If set to YES,  anonymous  users  will  be  permitted  to
          upload  files under certain conditions. For this to work,
          the option write_enable must be activated, and the anony‐
          mous  ftp  user  must  have  write  permission on desired
          upload locations. This setting is also required for  vir‐
          tual  users  to  upload;  by  default,  virtual users are
          treated with anonymous (i.e. maximally restricted) privi‐
          lege.

权限默认为no

anon_other_write_enable 代表可以对文件重命名或者删除

把这条命令追加入到配置文件,可以令anon的权限最大化

可以使用过滤去查看验证功能是否开启

[[email protected] vsftpd]# grep -v ‘#‘ vsftpd.conf
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=NO
listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
[[email protected] vsftpd]#

2.4 修改过的配置文件,需要重新加载服务才能生效

[[email protected] vsftpd]# systemctl reload vsftpd
Failed to reload vsftpd.service: Job type reload is not applicable for unit vsftpd.service.
See system logs and ‘systemctl status vsftpd.service‘ for details.
[[email protected] vsftpd]# systemctl restart vsftpd
[[email protected] vsftpd]# service reload vsftpd
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
[[email protected] vsftpd]# service vsftpd reload
Reloading vsftpd configuration (via systemctl):  Failed to reload vsftpd.service: Job type reload is not applicable for unit vsftpd.service.
See system logs and ‘systemctl status vsftpd.service‘ for details.
                                                           [失败]

重新加载不好使,只好重启了

2.5 在vsftpd中将anon的权限最大化放宽,还要考虑到文件自身的权限有没有被放宽

[[email protected] vsftpd]# cd /var/ftp
[[email protected] ftp]# ls -al
total 12
drwxr-xr-x.  4 root root   62 Dec  7 14:53 .
drwxr-xr-x. 24 root root 4096 Nov 22 14:43 ..
drwxr-xr-x.  2 root root    6 Nov 22 14:51 centos7
-rw-r--r--.  1 root root  909 Nov 22 15:17 ks.cfg
drwxr-xr-x.  2 root root    6 Oct 31  2018 pub
-rw-r--r--.  1 root root    7 Dec  7 14:53 test.txt

先测试一下

ftp> put 999.txt
200 PORT command successful. Consider using PASV.
553 Could not create file.

依旧不可以,把ftp权限放开

[[email protected] ftp]# chmod 777 /var/ftp
[[email protected] ftp]# ls -al
total 12
drwxrwxrwx.  4 root root   62 Dec  7 14:53 .
drwxr-xr-x. 24 root root 4096 Nov 22 14:43 ..
drwxr-xr-x.  2 root root    6 Nov 22 14:51 centos7
-rw-r--r--.  1 root root  909 Nov 22 15:17 ks.cfg
drwxr-xr-x.  2 root root    6 Oct 31  2018 pub
-rw-r--r--.  1 root root    7 Dec  7 14:53 test.txt

可以了

ftp> put 999.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 发送 7 字节,用时 0.00秒 3.50千字节/秒。

去服务端查看验证

[[email protected] ftp]# ls -al
total 16
drwxrwxrwx.  4 root root   77 Dec  7 15:32 .
drwxr-xr-x. 24 root root 4096 Nov 22 14:43 ..
-rw-------.  1 ftp  ftp     7 Dec  7 15:32 999.txt
drwxr-xr-x.  2 root root    6 Nov 22 14:51 centos7
-rw-r--r--.  1 root root  909 Nov 22 15:17 ks.cfg
drwxr-xr-x.  2 root root    6 Oct 31  2018 pub
-rw-r--r--.  1 root root    7 Dec  7 14:53 test.txt

同理也可以去改pub

2.6 接下来测试删除自己上传的文件

ftp> delete 999.txt
250 Delete operation successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
centos7
ks.cfg
pub
test.txt
226 Directory send OK.
ftp: 收到 35 字节,用时 0.00秒 35.00千字节/秒。
[[email protected] ftp]# ls -al
total 12
drwxrwxrwx.  4 root root   62 Dec  7 15:36 .
drwxr-xr-x. 24 root root 4096 Nov 22 14:43 ..
drwxr-xr-x.  2 root root    6 Nov 22 14:51 centos7
-rw-r--r--.  1 root root  909 Nov 22 15:17 ks.cfg
drwxr-xr-x.  2 root root    6 Oct 31  2018 pub
-rw-r--r--.  1 root root    7 Dec  7 14:53 test.txt

测试删除原有的文件

ftp> delete test.txt
250 Delete operation successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
centos7
ks.cfg
pub
226 Directory send OK.
ftp: 收到 25 字节,用时 0.00秒 12.50千字节/秒。
[[email protected] ftp]# ls -al
total 8
drwxrwxrwx.  4 root root   46 Dec  7 15:37 .
drwxr-xr-x. 24 root root 4096 Nov 22 14:43 ..
drwxr-xr-x.  2 root root    6 Nov 22 14:51 centos7
-rw-r--r--.  1 root root  909 Nov 22 15:17 ks.cfg
drwxr-xr-x.  2 root root    6 Oct 31  2018 pub

也可以执行

三 :接下来测试普通用户

[[email protected] ftp]# useradd zhangsan
[[email protected] ftp]# useradd lisi
[[email protected] ftp]# echo "123123" | passwd zhangsan --stdin
Changing password for user zhangsan.
passwd: all authentication tokens updated successfully.
[[email protected] ftp]# echo "123123" | passwd lisi --stdin
Changing password for user lisi.
passwd: all authentication tokens updated successfully.

接下来在客户机以新创建的用户去远程登陆

E:\>ftp 192.168.247.140
连接到 192.168.247.140。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.140:(none)): zhangsan
331 Please specify the password.
密码:
230 Login successful.
ftp>
ftp>
ftp>
ftp> pwd
257 "/home/zhangsan"

3.1 可以发现在自己的家目录下

接下来进行上传测试

ftp> put 999.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 发送 7 字节,用时 0.00秒 7.00千字节/秒。
[[email protected] ftp]# ls /home/zhangsan
999.txt
[[email protected] ftp]#

3.2 切换目录,发现普通用户可以随意切换

ftp> cd /
250 Directory successfully changed.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
226 Directory send OK.
ftp: 收到 107 字节,用时 0.01秒 9.73千字节/秒。

这对服务器安全而言是一种隐患

接下来去修改相应的配置选项

#chroot_local_user=YES      ‘禁止本地用户切换目录‘
allow_writeable_chroot=YES      ‘centos7中还需要额外开启这一项‘

启用它,保存退出,重启服务

ftp> ls
远程主机关闭连接。

使用bye命令退出ftp模式,重新登录

E:\>ftp 192.168.247.142
连接到 192.168.247.142。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.142:(none)): zhangsan
331 Please specify the password.
密码:
230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
ftp> ls -a
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
.
..
.bash_logout
.bash_profile
.bashrc
.mozilla
226 Directory send OK.
ftp: 收到 58 字节,用时 0.00秒 14.50千字节/秒。
ftp> pwd
257 "/"
ftp> cd /etc
550 Failed to change directory.
ftp>

3.3 接下来配置用户名单user——list

如果使用userlist_deny=NO,则仅允许名单内的这些用户访问

如果使用userlist_deny=YES (默认),则不允许名单内的这些用户访问

可以把zhangsan追加进去测试

[[email protected] ftp]# echo "zhangsan" >> /etc/vsftpd/user_list
[[email protected] ftp]#

重新加载服务后再次登陆,发现登陆失败

E:\>ftp 192.168.247.140
连接到 192.168.247.140。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.140:(none)): zhansan
331 Please specify the password.
密码:
530 Login incorrect.
登录失败。
ftp>
ftp> ls
530 Please login with USER and PASS.
530 Please login with USER and PASS.
ftp>

增加用户列表限制,只允许列表内的用户访问,然后重启服务

[[email protected] ftp]# vim /etc/vsftpd/vsftpd.conf
userlist_enable=YES         ‘代表用户列表开启‘
userlist_deny=NO        ‘增加仅允许用户列表内用户访问‘

测试,发现生效

E:\>ftp 192.168.247.140
连接到 192.168.247.140。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.140:(none)): lisi
530 Permission denied.
登录失败。
ftp> bye
221 Goodbye.

E:\>ftp 192.168.247.140
连接到 192.168.247.140。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.140:(none)): zhangsan
331 Please specify the password.
密码:
230 Login successful.
ftp>

把刚才增加的配置删除,继续测试

四 :虚拟用户

4.1 先创建/etc/vsftpd/vuser文件

里面写虚拟账户的账号和密码

[[email protected] ftp]# cd /etc/vsftpd/
[[email protected] vsftpd]# vim vuser
[[email protected] vsftpd]# cat vuser
lisa
123123
tom
123123

4.2 把vuser文件转换成数据库文件

-T 代表转换 -t 代表类型 hash 代表哈希算法类型 -f 指定文件

[[email protected] vsftpd]# db_load -T -t hash -f vuser vuser.db
[[email protected] vsftpd]#
[[email protected] vsftpd]# ls -al
total 48
drwxr-xr-x.   2 root root   117 Dec  7 16:37 .
drwxr-xr-x. 140 root root  8192 Dec  7 15:41 ..
-rw-------.   1 root root   125 Oct 31  2018 ftpusers
-rw-------.   1 root root   370 Dec  7 16:03 user_list
-rw-------.   1 root root  5142 Dec  7 16:11 vsftpd.conf
-rwxr--r--.   1 root root   338 Oct 31  2018 vsftpd_conf_migrate.sh
-rw-r--r--.   1 root root    23 Dec  7 16:33 vuser
-rw-r--r--.   1 root root 12288 Dec  7 16:37 vuser.db

为了安全,修改这两个文件为600权限

[[email protected] vsftpd]# chmod 600 vuse*
[[email protected] vsftpd]# ls -al
total 48
drwxr-xr-x.   2 root root   117 Dec  7 16:37 .
drwxr-xr-x. 140 root root  8192 Dec  7 15:41 ..
-rw-------.   1 root root   125 Oct 31  2018 ftpusers
-rw-------.   1 root root   370 Dec  7 16:03 user_list
-rw-------.   1 root root  5142 Dec  7 16:11 vsftpd.conf
-rwxr--r--.   1 root root   338 Oct 31  2018 vsftpd_conf_migrate.sh
-rw-------.   1 root root    23 Dec  7 16:33 vuser
-rw-------.   1 root root 12288 Dec  7 16:37 vuser.db

4.3 创建虚拟用户对应的账户

[[email protected] vsftpd]# useradd -d /opt/vuser -s /sbin/nologin vuser
[[email protected] vsftpd]# grep ‘vuser‘ /etc/passwd
vuser:x:1003:1003::/opt/vuser:/sbin/nologin
[[email protected] vsftpd]# ls /opt
192.168.139.132  rh  vuser

4.4 使用pam认证模块开启支持虚拟用户登陆

新建一个pam模块文件,/etc/pam.d/vsftpd.vu,在里面写入

auth required pam_userdb.so db=/etc/vsftpd/vuser
account required pam_userdb.so db=etc/vsftpd/vuser

注意,db后面的文件代表的是以db为后缀的文件

[[email protected] vsftpd]# cd /etc/pam.d/
[[email protected] pam.d]# cat vsftpd
#%PAM-1.0
session    optional     pam_keyinit.so    force revoke
auth       required     pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth       required     pam_shells.so
auth       include      password-auth
account    include      password-auth
session    required     pam_loginuid.so
session    include      password-auth
[[email protected] pam.d]# vim vsftpd.vu
[[email protected] pam.d]# cat vsftpd.vu
auth required pam_userdb.so db=/etc/vsftpd/vuser
account required pam_userdb.so db=etc/vsftpd/vuser
[[email protected] pam.d]#

4.5 接下来开始修改配置文件

[[email protected] vsftpd]# vim vsftpd.conf 

#pam_service_name=vsftpd        ‘关掉这个命令‘
guest_enable=YES            ‘加入来宾功能‘
guest_username=vuser
pam_service_name=vsftpd.vu      ‘pam模块服务指定刚才新建的模块‘
[[email protected] pam.d]# tail -9 /etc/vsftpd/vsftpd.conf
# Make sure, that one of the listen options is commented !!
listen_ipv6=YES

#pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=YES
pam_service_name=vsftpd.vu

修改完毕,开始重启服务

4.6 接下来就可以使用虚拟用户登陆,上传文件

E:\>ftp 192.168.247.142
连接到 192.168.247.142。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.142:(none)): lisa
331 Please specify the password.
密码:
230 Login successful.
ftp>
ftp>
ftp>
ftp>
ftp>
ftp> put 999.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 发送 7 字节,用时 0.00秒 7.00千字节/秒。
ftp>

查看服务端验证

[[email protected] vuser]# cd /etc/vsftpd/
[[email protected] vsftpd]# cd /opt/vuser
[[email protected] vuser]# ls
999.txt
[[email protected] vuser]#

切换另一个用户

E:\>ftp 192.168.247.142
连接到 192.168.247.142。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.142:(none)): tom
331 Please specify the password.
密码:
230 Login successful.
ftp> put 911.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp: 发送 7 字节,用时 0.00秒 7.00千字节/秒。
ftp>
[[email protected] vuser]# ls -al
total 20
drwx------. 3 vuser vuser 108 Dec  8 16:46 .
drwxr-xr-x. 5 root  root  142 Dec  8 15:13 ..
-rw-------. 1 vuser vuser   7 Dec  8 16:46 911.txt
-rw-------. 1 vuser vuser   7 Dec  8 16:39 999.txt
-rw-r--r--. 1 vuser vuser  18 Aug  3  2017 .bash_logout
-rw-r--r--. 1 vuser vuser 193 Aug  3  2017 .bash_profile
-rw-r--r--. 1 vuser vuser 231 Aug  3  2017 .bashrc
drwxr-xr-x. 4 vuser vuser  39 Oct 23 13:35 .mozilla

4.7 还可以单独给用户创建配置目录,去指定用户的权限

[[email protected] vuser]# vim /etc/vsftpd/vsftpd.conf
user_config_dir=/etc/vsftpd/vu_dir      ‘添加‘
[[email protected] vuser]# cd /etc/vsftpd
[[email protected] vsftpd]# mkdir vu_dir
[[email protected] vsftpd]# cd vu_dir/
[[email protected] vu_dir]# vim tom
anon_umask=022
E:\>ftp 192.168.247.142
连接到 192.168.247.142。
220 (vsFTPd 3.0.2)
200 Always in UTF8 mode.
用户(192.168.247.142:(none)): tom
331 Please specify the password.
密码:
230 Login successful.
ftp> put 744.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
ftp>
[[email protected] vuser]# ls -al
total 20
drwx------. 3 vuser vuser 138 Dec  8 16:53 .
drwxr-xr-x. 5 root  root  142 Dec  8 15:13 ..
-rw-r--r--. 1 vuser vuser   0 Dec  8 16:53 744.txt
-rw-------. 1 vuser vuser   0 Dec  8 16:50 755.txt
-rw-------. 1 vuser vuser   7 Dec  8 16:46 911.txt
-rw-------. 1 vuser vuser   7 Dec  8 16:39 999.txt
-rw-r--r--. 1 vuser vuser  18 Aug  3  2017 .bash_logout
-rw-r--r--. 1 vuser vuser 193 Aug  3  2017 .bash_profile
-rw-r--r--. 1 vuser vuser 231 Aug  3  2017 .bashrc
drwxr-xr-x. 4 vuser vuser  39 Oct 23 13:35 .mozilla

原文地址:https://blog.51cto.com/14558445/2456992

时间: 2024-08-29 20:30:39

理论+实操:FTP服务详细介绍优化,创建虚拟用户的相关文章

Oracle 11g必须开启的服务及服务详细介绍

成功安装Oracle 11g数据库后,你会发现自己电脑运行速度会变慢,配置较低的电脑甚至出现非常卡的状况,通过禁止非必须开启的Oracle服务可以提升电脑的运行速度.那么,具体该怎么做呢? 按照win7 64位环境下Oracle 11g R2安装详解中的方法成功安装Oracle 11g后,共有7个服务,分别为Oracle ORCL VSS Writer Service,OracleDBConsoleorcl,OracleJobSchedulerORCL, OracleMTSRecoverySer

MySQL——全量、增量备份与恢复(理论+实操)

数据备份的重要性 1.在生产环境中,数据的安全性是至关重要的,任何数据的丢失都可能产生严重的后果 2.造成数据丢失的原因 程序错误 人为错误 计算机失败 磁盘失败 灾难和偷窃 数据库备份的分类 从物理与逻辑的角度,备份可分为: 1.物理备份:对数据库操作系统的物理文件(如数据文件.日志文件等)的备份 物理备份又可以分为脱机备份(冷备份)和联机备份(热备份): 冷备份:是在关闭数据库的时候进行的热备份:数据库处于运行状态,这种备份方法依赖于数据库的日志文件 2.逻辑备份:对数据库逻辑组件(如表等数

FTP服务最安全认证模式---虚拟账户访问

虚拟账户概述 因为在linux下,使用vsftp建立用户之后,默认使用ftp访问的时候,是会访问到对应的用户家目录.如果想多个用户同时访问某一个目录,同时对同一目录下有着不同的权限,比如部分用户只能看,不修改,或者有的用户只能下载不能上传这些权限,这些设定只能通过vsftp中的虚拟用户来进行设定,普通的用户无法达到这样的效果. 虚拟账户模式是最安全的一种认证模式,它需要为FTP服务单独建立用户数据库文件,虚拟出的用户进行口令验证账户信息,而这些账户信息在服务器其实是并不存在的,它仅供FTP服务器

FTP(五)创建虚拟用户

创建虚拟用户 所谓虚拟用户就是,所有虚拟用户会统一赢谁为一个指定的系统普通账号:访问共享位置,即为此系统普通用户的家目录,当然每个虚拟用户也可被赋予不同的访问权限,通过匿名用户的权限控制参数进行指定 虚拟用户帐号的存储方式: 1,创建专门一个文件存放用户密码,但是该文件需要用hash格式.所以需要用下面的这条命令: db_load -T -t hash -f vusers.txt vusers.db 实现步骤: 一,创建用户数据库文件 "注意该文件的格式:第一行 用户名,第二行 密码,以此类推&

理论+实操:深入理解Linux文件系统与日志分析

前言: inode(文件节点)与block(数据块) 硬链接与软连接 恢复误删除的文件 (即rm-rf 的操作,可以先进行备份的操作,然后可以进行恢复ext4和xfs文件系统皆可) 日志文件的分类 用户日志与程序日志 一 :inode和block概述 1.1 概述 文件数据包括元信息与实际数据 文件存储在硬盘上,硬盘最小存储单位是"扇区",每个扇区储存512字节 block(块) 连续的八个扇区组成一个block,一个block单位是4k 是文件存取的最小单位 inode(索引节点)

理论+实操:LVM与磁盘配额

[TOC] 前言: LVM是逻辑卷管理的简称,它是Linux环境下对磁盘分区管理的一种机制,实现文件系统跨越不同磁盘和分区,工作原理是将若干个磁盘分区连接成一个整块卷组,在卷组上随意创建逻辑卷组,最后在逻辑卷组上创建文件系统,管理员可以动态调整逻辑卷的大小,不会丢失现有的数据,通过创建LVM可以对磁盘进行动态管理. 一:LVM(逻辑卷)概述 1.1 Logical Volume Manager,逻辑卷管理 动态调整磁盘容量,从而提高磁盘管理的灵活性 /boot(系统内核)分区用于存放引导文件,不

DICOM:DICOM Print 服务详细介绍

背景: 昨天专栏中发表了一篇关于DICOM Print的博文DICOM:DICOM Print服务中PresentationContext协商之 MetaSOPClass与SOPClass对比分析,文章从部署中遇到的实际情况出发,对DICOM Print中的连接协商(Association Negotiation)进行了剖析,本文可看做是上一篇博文的补充,重新浏览和整理了DICOM3.0标准中对DICOM Print 服务的介绍,加深对DICOM打印的理解. DICOM Print服务数据流:

理论+实操:apache 的虚拟web主机配置

@[toc]apache 常用的功能,虚拟主机 一:虚拟Web主机 在同一台服务器中运行多个Web站点,其中每一个站点并不独立占用一台真正的计算机 1.1 httpd支持的虚拟主机类型(三种) 基于域名的类型 基于IP地址的虚拟主机 基于端口的虚拟主机例如:www.kgc.omwww.accp.comIP相同,端口相同 IP不同,端口相同 IP相同,端口不通 二:构建虚拟主机基于域名的实验 2.1.1 安装软件包 [[email protected] ~]# yum install bind h

理论+实操 :华为NAT地址转换

前言:nat地址转换可以让私有地址转换成公网地址,解决上网问题华为的三层交换机内不可以配ip地址,需要配vlanif 在企业当中,数据流量业务比较多时,用好一点的路由器多个私网地址对应外网口ip地址需要设置acl规则,只允许某个网段通行,后面跟子网反掩码接着到外网口宣告一下,acl的编号即可 网路地址转换 一: NAT概述 1.1 NAT的概念与实现方式 地址转换出现的背景 NAT的工作原理 network address translation,网路地址转换 NAT实现方式 静态转换(stat