我的数据表上面有两个表字段没有数据,这两个字段对应的都是叫血缘的功能,在日志上面查看这个血缘的功能问题,显示说连接超时,可是我不知道我这个主机现在的应用连的是哪个FTP,我想找到对应的FTP,然后找到FTP的配置文件去对接口重新连接
1、ps -ef | grep 应用程序名,查看该应用程序相关的所有进程
2、lsof -p 进程ID,查看与该应用程序相关的所有打开的文件和网络连接
3、根据输出结果,找到与FTP相关的连接或文件。
/etc/vsftpd.conf看下有没有相关配置文件
借鉴 https://ubuntu.com/server/docs/service-ftp
说明,这个功能不是说只允许列表中用户登陆ftp,而是说列表中的用户不受功能限制,比如下面限制了本地用户不能翻目录,但列表中的用户依然是可以翻目录的【其他用户只能登陆到家目录不能切换其他目录】,就是这样,之前我以为是这个只允许列表中用户登陆ftp,其他用户无法登陆,折腾了很久,发现是我理解错了。
chroot_list_enable=YES
开启代表用户列表文件/etc/vsftpd/chroot_list
中的用户可以访问【需要在/etc/vsftpd
目录下创建文件chroot_list
,在文件中写入用户名,一行一个用户】,未在文件中列出的用户不能访问
需要修改3处
allow_writeable_chroot=YES
【已添加忽略】chroot_local_user=YES
chroot_list_enable=YES
#和上面是配套使用的[root@centos76_2 ~]# vim /etc/vsftpd/vsftpd.conf
103 allow_writeable_chroot=YES
104 chroot_local_user=YES
105 chroot_list_enable=YES
[root@centos76_2 ~]# systemctl restart vsftpd
[root@centos76_2 ~]# cd /etc/vsftpd/
[root@centos76_2 vsftpd]# ls
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
[root@centos76_2 vsftpd]# vim chroot_list # 创建允许登陆的用户
hero1
hero2
[root@centos76_2 vsftpd]# useradd -s /sbin/nologin hero1 #创建用户名和密码
[root@centos76_2 vsftpd]# useradd -s /sbin/nologin hero2
[root@centos76_2 vsftpd]# echo hero1|passwd --stdin hero1
Changing password for user hero1.
passwd: all authentication tokens updated successfully.
[root@centos76_2 vsftpd]# echo hero2|passwd --stdin hero2
Changing password for user hero2.
passwd: all authentication tokens updated successfully.
[root@centos76_2 vsftpd]#