ftp和ssh账户访问限制
服务器:ubuntu
ftp服务:vsftpd
ftp只允许用户访问自己的主目录:
- vi /etc/vsftpd.conf
- 将chroot_list_enable=YES,chroot_list_file=/etc/vsftpd.chroot_list两行注释打开
- 设置用户的配置文件,添加一行:user_config_dir=/etc/local_root
- vi /etc/vsftpd.chroot_list
- 写入要限制的用户,如:user1
- cd /etc/local_root
- vi user1
- 写入user1用户的主目录:local_root=/home/user1
- 重新启动vsftpd即可
禁止ssh用户登陆,方案:采用白名单,只有设定的用户才能ssh登录,其他用户统统取消
- vi /etc/ssh/sshd_config
- 添加:AllowUsers username
- 重新启动ssh
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步