How to prohibit vsftpd users from logging in through ssh

How to prohibit vsftpd users from logging in through ssh

Preface

vsftp is an easy-to-use and secure ftp server software. You can log in using a system user or a virtual user. If you log in using a system user, by default, the user can log in to the system. This means that you can log in to the ftp server and you can also log in to the system. This is sometimes unsafe because you can see many files when you log in to the system.

Create a system account and only allow this account to log in to ftp

First: Add /bin/false to the file /etc/bash

cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/bin/false

Second: Specify user (zhangsan) to use /bin/false

usermod -s /bin/false zhangsan

After two steps of setup, users can only use the FTP server and are prohibited from logging into the system.

Remark

  • /bin/false and /sbin/nologin are different. The common part is that users cannot log into the system. The method may be different. I tried /bin/fase in the centos7 environment, but there was no prompt when logging in and it exited directly.
  • When configuring ftp before, just using /sbin/nologin seemed to be able to achieve the desired effect, but now you need to use /bin/false to solve it.

Possible causes

If it was possible to use /sbin/nologin before and system users could only log in to ftp, then this is not possible in my current environment, which means that this is related to the system settings and vsftp configuration.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM.

You may also be interested in:
  • VSFTPD configuration (anonymous - local user - virtual user)
  • vsftpd virtual user configuration steps
  • How to install vsftpd and configure multiple users in Centos6.9
  • Compile and install vsftpd server on Linux (local user authentication method)
  • vsftpd anonymous user upload and download configuration method
  • Establishing VSftpd service based on virtual users
  • Build a vsftpd server application based on virtual users
  • How to install vsftpd and PAM virtual users on centos 6
  • Detailed explanation of using shell scripts to prevent ssh and vsftpd brute force cracking

<<:  Detailed tutorial on customizing the installation path of MySQL 5.7.18 version (binary package installation)

>>:  Detailed usage of React.Children

Recommend

Implementation of multi-environment configuration (.env) of vue project

Table of contents What is multi-environment confi...

Detailed tutorial for downloading and installing mysql8.0.21

Official website address: https://www.mysql.com/ ...

Solution to Nginx SSL certificate configuration error

1. Introduction When a web project is published o...

How to use .htaccess to prohibit a certain IP from accessing the website

Preface For cost considerations, most webmasters ...

How does Vue implement communication between components?

Table of contents 1. Communication between father...

HTML is something that web page creators must learn and master.

What are the benefits of learning HTML? 1: Easily...

Solve the problem of running hello-world after docker installation

Installed Docker V1.13.1 on centos7.3 using yum B...

Summary of three ways to implement ranking in MySQL without using order by

Assuming business: View the salary information of...

The difference between MySQL execute, executeUpdate and executeQuery

The differences among execute, executeUpdate, and...

How to monitor mysql using zabbix

Zabbix deployment documentation After zabbix is ​...

JavaScript Factory Pattern Explained

Table of contents Simple Factory Factory Method S...

mysql8.0.11 winx64 installation and configuration tutorial

The installation tutorial of mysql 8.0.11 winx64 ...