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

Hello dialog box design experience sharing

"What's wrong?" Unless you are accus...

uniapp implements date and time picker

This article example shares the specific code of ...

display:grid in CSS3, an introduction to grid layout

1. Grid layout (grid): It divides the web page in...

Application of HTML and CSS in Flash

Application of HTML and CSS in Flash: I accidental...

Use a few interview questions to look at the JavaScript execution mechanism

Table of contents Previous words Synchronous and ...

Implementation of single process control of Linux C background service program

introduce Usually a background server program mus...

VMware ESXi installation and use record (with download)

Table of contents 1. Install ESXi 2. Set up ESXi ...

Getting Started with Front-End Vue Unit Testing

Table of contents 1. Why do we need unit testing?...

React handwriting tab switching problem

Parent File import React, { useState } from '...

How to change the character set encoding to UTF8 in MySQL 5.5/5.6 under Linux

1. Log in to MySQL and use SHOW VARIABLES LIKE &#...

Several things to note when making a web page

--Homepage backup 1.txt text 2. Scan the image 3. ...