Create SFTP user and allow access to specific directory | SFTP Chroot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to encryption to take tips and tutorials channel in today's video we will be diving in how to create an SFTP user and provide access to a specific directory in addition to this the user will not have access to the server's console in other words the SFTP user will not be able to log into the server via the best sale so let's get started SFTP is just a secure version of FTP which encrypts data while it moves from a source to the destination as a system administrator or a developer you might have come into a situation where you wanted to allow access to a specific user or another developer access to just a directory out of the several directories in the web server that is what exactly I am going to show you how you can achieve it I am here in my web server and websites are hosted on this directory slash pair slash www I want to Grant access to a new upper just to this directory out of several other directories for security reasons and prevent potential mistakes that might take the server down or the server may lose the data to start we'll first create a user named SFTP without access to still let's verify if the user is created yes the user is created with the user id1002 now let's set a strong password for the user type the password and hit enter again type the password and hit enter to confirm that the last entry of the password matches with the previous one OK the password is updated successfully next let's try to log into the server's cell or console using the newly created users credentials as you can see we are restricted to log in now to configure directory access to the user let's open the SSS configuration file which is slash Etc SSH slash sssd underscore config after the file is Open Press backslash key and type subsystem hit enter and press I key to switch the editor to the insert mode then type the configuration parameters as I am typing on the screen here thank you foreign path if you are using something different than mine then press the Escape key type colon X and hit enter to save and exit the file after modifying the SSS configuration we need to restart the SSS D service using sudo space service space sssd space restart that's all to verify open a SFTP client application such as filezilla to know the server's IP address I go to the servers terminal and query the IP address with curl space ifconfig dot me copy the IP address from here and enter here in the file delaj host box as SFTP colon slash the IP address username is SFTP user enter the password enter the port number which is 22 and click on the quick connect button here we go the user is connected via the SFTP and the contents of the allowed directory is listed here to verify if the user has the right access create a new file such as test.html or so the file is created successfully this verifies that the user can read and write to the directory and subdirectories checking on the server we can see the file is created by the user now let's try to login as another aspective user just to try if everything is in place and nothing has gone wrong I have another SFTP user here named developer I am going to log in using the developer users credentials foreign as you can see I am logged in and the user's home directory listed by default the user however can switch to the slash bear slash www directory as well okay friends this is how we can create a SFTP user and allow access to a specific directory I hope the video was useful to you please subscribe to the channel and hit the Bell icon thanks for watching see you on other videos till then have a nice time goodbye
Info
Channel: Enkripsan
Views: 9,273
Rating: undefined out of 5
Keywords: sftp, sftp chroot, sftp server, system administrator, it professional, chroot linux, sysadmin, configurer sftp linux, sftp server and client, How to Create an SFTP User and Provide Directory Access, Secure File Transfers, SFTP User, Directory Access, FileZilla, ftp server
Id: XhnqJ4S7C10
Channel Id: undefined
Length: 5min 41sec (341 seconds)
Published: Wed Jun 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.