Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The realization method of forbidding ssh login by vsftpd users

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Preface

Vsftp is an easy to use and secure ftp server-side software. You can use system users to log in, or you can use virtual users to log in. If the user logs in with the system, by default, the user can log in to the system. It means that you can log in to the ftp server or log in to the system. This is sometimes not safe, because logging in to the system, you can see a lot of files.

Create a system account and just 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 the user (zhangsan) to use / bin/false

Usermod-s / bin/false zhangsan

After two steps of setup, users can only use the ftp server, and login to the system is prohibited.

Remarks

/ bin/false and / sbin/nologin are different. The common part is that users are unable to log in to the system. The way may be different. Try / bin/fase login under the centos7 environment without prompt, just exit. In the past, when you configured ftp, you just used / sbin/nologin to achieve the desired effect, but now you need to use / bin/false to solve it.

Possible reasons

If it can be implemented with / sbin/nologin before, and system users can only log in to ftp, then my environment is not good now, which means that this has something to do with the system settings and the configuration of vsftp.

Summary

The above is the whole content of this article, I hope that the content of this article has a certain reference and learning value for your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report