How Add Sftp User in Linux?
Contents

How do I give someone an SFTP user in Linux?

tl;dr

  1. useradd <your sftp user> -s /sbin/nologin -M.
  2. passwd <your sftp user> Enter your sftp user password and confirm.
  3. vi /etc/ssh/sshd_config.
  4. Match User <your sftp user> ChrootDirectory <your sftp user directory> ForceCommand internal-sftp. AllowTcpForwarding no. X11Forwarding no.
  5. service sshd restart ​

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.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest