Linux Server restricts FTP user access, linuxftp
File Transfer Protocol (FTP) is a Protocol used to upload and download files between computers. FTP works in Client/Server mode. The FTP server continuously monitors FTP requests from distant clients. After receiving requests from distant clients, it manages login and establishes connections. Execute the commands sent from the FTP client during the session creation. The FTP server can be managed anonymously or authenticated. For the sake of security, most LINUX systems will consider using the Authentication mode, that is, entering/accessing the FTP server, the user name or password must be used.
Because FTP is not a secure protocol, it must be restricted as much as possible. For security reasons, many systems use CHROOT jail (Prison). Therefore, FTP users are prohibited from accessing other directories except their home directories (/home/username.
The following describes how to configure, log on to the server, and connect sudo to the root user.
- Backup:/etc/vsftpd. conf file:
-
- #Cp/etc/vsftpd. conf/etc/vsftpd. conf. old
- Edit:/etc/vsftpd. conf file:
If not, add the following lines:
Userlist_enable = YES
Userlist_deny = NO
Anonymous_enable = NO
- Note: users in/etc/vsftpd/user_list only retain users who must use FTP. This user must match the specific FTP login method.
# Vsftpd userlist
# If userlist_deny = NO, only allow users in this file
# If userlist_deny = YES (default), never allow users in this file,
# And
# Do not even prompt for a password.
# Note that the default vsftpd pam config also checks
#/Etc/vsftpd. ftpusers
# For users that are denied.
Ftpuse
- On the server, upload HUP to suspend the process to the vsftpd service process. 1. First find the PID Process
#Ps-ef | grep vsftpd2. Then enter the following command #Kill-HUP <PID of vsftpd>
Other commands for managing ftp services:
[Root] # service vsftpd stop // --> stop ftp service
[Root] # service vsftpd start // --> start ftp service
[Root] # service vsftpd status // --> View ftp service status
How can I configure a linux ftp server to be accessible only to a specified user?
Vi/etc/vsftpd. conf
Userlist_deny = NO/the persons in this list will not be rejected, and others will be rejected (including anonymous)
Userlist_file =/etc/mp/specifies the path of the List
Then: # vi/etc/mp Add the accessible name
Restart the vsftpd service!
In Linux FTP server, how does one restrict users to their own directories?
Open and edit/etc/vsftpd. conf
# Vi/etc/vsftpd. conf
Add or remove the following line comment
Chroot_local_user = YES
Save and restart vsftpd
#/Etc/init. d/vsftpd restart
Now, you only need to switch to another directory, and a 550 Failed to change directory will be displayed.