Centos7下安装vsftp并配置虚拟用户

一、安装前准备 1.关闭防火墙或者运行ftp服务 # 关闭防火墙 systemctl stop firewalld systemctl disable firewalld # 允许ftp服务 firewall-cmd --permanent --zone=public --add-service=ftp firewall-cmd --reload 2.关闭sellinux # 立即关闭 setenforce 0 # 永久关闭 sed -i 's@SELINUX=enforcing@SELINUX=disabled@' /etc/selinux/config # 查看是否关闭 getenforce 二、安装vsftpd 1.安装 yum install -y vsftpd 2.启动和自启 systemctl start vsftpd systemctl enable vsftpd 三、配置vsftpd 1.创建vsftpd使用的系统用户,主目录为/data/vsftpd,禁止ssh登录。创建之后所有虚拟用户使用这个系统用户访问文件。 useradd vsftpd -d /data/vsftpd -s /bin/false 2.创建虚拟用户主目录,比如虚拟用户叫ftp1,执行下面的命令。 mkdir -p /data/vsftpd/ftp1/ chown -R vsftpd:vsftpd /data/vsftpd/ftp1 3.创建这个虚拟用户 vi /etc/vsftpd/loginusers.conf # 增加内容 ftp1 123456 4.根据这个文件创建数据库文件 db_load -T -t hash -f /etc/vsftpd/loginusers.conf /etc/vsftpd/loginusers.db chmod 600 /etc/vsftpd/loginusers.db 5.启用这个数据库文件 vi /etc/pam.d/vsftpd # 注释掉所有内容后,增加下面的内容 auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/loginusers account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/loginusers 6.创建虚拟用户配置目录和文件 # 创建用户配置目录 mkdir /etc/vsftpd/userconf # 创建虚拟用户配置文件 vim /etc/vsftpd/userconf/ftp1 # 增加下面的内容 local_root=/data/vsftpd/ftp1/ write_enable=YES 7.最后修改主配置文件 # 打开配置 vim /etc/vsftpd/vsftpd.conf # 更改内容 anonymous_enable=NO chroot_local_user=YES ascii_upload_enable=YES ascii_download_enable=YES # 文件尾部添加以下内容 guest_enable=YES guest_username=vsftpd user_config_dir=/etc/vsftpd/userconf allow_writeable_chroot=YES # 浏览FTP目录和下载 anon_world_readable_only=NO # 允许上传 anon_upload_enable=YES # 允许建立和删除目录 anon_mkdir_write_enable=YES # 允许改名和删除文件 anon_other_write_enable=YES 8.重启服务 service vsftpd restart 9.出现vsftpd 425 Security: Bad IP connecting.解决方法 vim /etc/vsftpd/vsftpd.conf # 添加: pasv_promiscuous=YES # 重启 service vsftpd restart

2023年1月13日 · 1 分钟 · 154 字 · AIHugoBlog

Centos7下安装node12和npm

1. 下载12x版本 curl --silent --location https://rpm.nodesource.com/setup_12.x | bash - 2. yum 安装 ## Run `sudo yum install -y nodejs` to install Node.js 13.x and npm. yum install -y nodejs ## You may also need development tools to build native addons: yum install gcc-c++ make ## To install the Yarn package manager, run: curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo yum install yarn 3. cnpm安装 npm install -g cnpm --registry=https://registry.npm.taobao.org

2023年1月13日 · 1 分钟 · 69 字 · AIHugoBlog

Linux下shell脚本tar自动压缩备份文件夹

代码如下: #!/bin/bash cd /home/raid_4t/100_hexo/blog/ tar -cpzf /home/raid_4t/100_hexo/bak/blog_$(date +%Y%m%d-%H%M).tar.gz *

2023年1月13日 · 1 分钟 · 9 字 · AIHugoBlog

Office转pdf打水印—Unoconv、Imagemagick

一、系统环境:Centos7 x64 uname -rvms 二、Office转PDF:Unoconv 1. 说明 unoconv是一个python脚本,再使用的时候需要用到libreo?ce-pyuno 2. 环境 yum install unzip yum install -y libreoffice-pyuno yum remove -y libreoffice* openoffice* # 去除因安装libreo?ce-pyuno带来的低版本libreoffice 3. libreoffice和unoconv下载 # 通过以下地址下载官方libreOffice_6.6.0 https://www.libreoffice.org/donate/dl/rpm-x86_64/6.4.0/zh-CN/LibreOffice_6.4.0_Linux_x86-64_rpm.tar.gz # 通过以下地址下载官方unoconv_0.8.2 https://github.com/unoconv/unoconv/archive/0.8.2.zip 4. 安装 # libreoffice上传至服务器后解压 tar zxvf LibreOffice_6.4.0_Linux_x86-64_rpm.tar.gz # 把所有rpm包都安装上,包括依赖 yum install LibreOffice_6.4.0.3_Linux_x86-64_rpm/RPMS/*.rpm -y # unoconv上传至服务器后解压至安装 unzip unoconv-0.8.2.zip cd unoconv-0.8.2/ make install 5. 安装转换检验 unoconv --version # 版本查看 # LibreO?ce版本应该是6.4,unoconv版本应该是0.8.2 # 检验是否可以转换文档 unoconv -f pdf -o /root/output.pdf /root/input.docx # 1.pdf为转换后的文件,1.docx为需要转换的文件 unoconv -f pdf -e PageRange=2-2 -o /root/output.pdf /root/input.docx # 只转换第2页 6. 中文问题解决 此时可能转出来的文档为空,或者中文乱码,解决方法如下 ...

2023年1月13日 · 2 分钟 · 345 字 · AIHugoBlog

docker配置国内阿里云镜像源

使用docker默认镜像源下载镜像会很慢,因此很多情况下,我们在安装完docker以后都会修改为国内的镜像,这样在下载镜像的时候就不用等那么长时间了。 方法一 $ cat /etc/sysconfig/docker # /etc/sysconfig/docker OPTIONS='--selinux-enabled \ --log-driver=journald \ --signature-verification=false \ --registry-mirror=https://kfwkfulq.mirror.aliyuncs.com' if [ -z "${DOCKER_CERT_PATH}" ]; then DOCKER_CERT_PATH=/etc/docker fi ##主要是配置这个参数 --registry-mirror ,指向阿里云镜像地址即可。 #重启docker服务 $ sudo systemctl restart docker 方法二 $ cd /etc/docker $ cat daemon.json { "registry-mirrors": [ "https://kfwkfulq.mirror.aliyuncs.com", "https://2lqq34jg.mirror.aliyuncs.com", "https://pee6w651.mirror.aliyuncs.com", "https://registry.docker-cn.com", "http://hub-mirror.c.163.com" ], "dns": ["8.8.8.8","8.8.4.4"] } 备注: 方法一和方法二不可同时使用,否则会冲突导致docker服务器启动不起来

2023年1月13日 · 1 分钟 · 52 字 · AIHugoBlog

ubuntu系统修改用户登录密码策略

1、打开配置文件:vim /etc/pam.d/common-password #历史密码10次不相同 password[success=1default=ignore]pam_unix.soobscureuse_authtoktry_first_passsha512remember=10 #设置最短密码和长度 password requisite pam_cracklib.so retry=3 minlen=12 difok=3 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 它表示密码必须至少包含一个大写字母(ucredit),一个小写字母(lcredit),一个数字(dcredit)和一个标点符号(ocredit),最小12位(minlen) 2、打开配置文件:vim /etc/login.defs #设置最长密码期限 PASS_MAX_DAYS 90

2023年1月13日 · 1 分钟 · 21 字 · AIHugoBlog

sqlite3数据库cmd命令导出表为txt或csv

首先,需要安装sqlite3 dos下输入命令:sqlite3.exe E:\目录\数据库A 输入命令:.tables //显示当前数据库的表 输入命令:.output E:\a.txt //要导出的txt文件所在目录和文件名 输入命令:select * from 表A //获取你要导出的数据 输入命令:.output stdout 然后到你指定的txt文件目录下查看,生成有你要生成的txt文件了,想导出成csv的把.txt改成.csv就可以了

2023年1月13日 · 1 分钟 · 16 字 · AIHugoBlog

Ubuntu系统忘记用户密码的解决办法

1、启动电脑,按esc或者shift,进入gurb界面,在第一行按“e” 2、在linux /boot/vmlinuz 把ro修改为 rw single init=/bin/bash 3、然后按ctrl+x或者按F10进入。修改用户密码 passwd 你的用户名,输入两次新密码。 4、按ctrl+alt+delete重启电脑,搞定。

2023年1月13日 · 1 分钟 · 11 字 · AIHugoBlog

ubuntu系统支持exfat格式

添加源: sudo add-apt-repository ppa:relan/exfat sudo apt-get update 安装fuse-exfat sudo apt-get install fuse-exfat exfat-utils

2023年1月13日 · 1 分钟 · 13 字 · AIHugoBlog

Ubuntu添加和删除源

1.添加PPA源的命令为 add-apt-repository ppa:user/ppa-name apt-get update 2.删除PPA源的命令为 add-apt-repository -r ppa:user/ppa-name

2023年1月13日 · 1 分钟 · 9 字 · AIHugoBlog