How Add Sftp User in Linux?
Contents How Do I Give Someone an Sftp User in Linux? Tl; Dr Useradd -S /Sbin/Nologin -M. Passwd Enter Your Sftp User Password and Confirm. Vi...
Contents
How do I give someone an SFTP user in Linux?
tl;dr
- useradd <your sftp user> -s /sbin/nologin -M.
- passwd <your sftp user> Enter your sftp user password and confirm.
- vi /etc/ssh/sshd_config.
- Match User <your sftp user> ChrootDirectory <your sftp user directory> ForceCommand internal-sftp. AllowTcpForwarding no. X11Forwarding no.
- service sshd restart
Must Read
Where is my SFTP user Linux?
To verify that the SFTP login works, connect to SFTP by running the following command, replacing myuser with the user that you have chosen, as shown in the following example: sftp [email protected] [email protected]’s password: Connected to localhost.