How To Set Up An SFTP Server On Linux TechRepublic
How To Set Up An SFTP Server On Linux TechRepublic
techrepublic.com
1 of 7 05/10/2022, 15.15
How to set up an SFTP server on Linux | TechRepublic about:reader?url=https%3A%2F%2Fwww.techrepublic.com%2Farticl...
2 of 7 05/10/2022, 15.15
How to set up an SFTP server on Linux | TechRepublic about:reader?url=https%3A%2F%2Fwww.techrepublic.com%2Farticl...
SFTP Directory
mkdir -p /data
3 of 7 05/10/2022, 15.15
How to set up an SFTP server on Linux | TechRepublic about:reader?url=https%3A%2F%2Fwww.techrepublic.com%2Farticl...
groupadd sftp_users
Now we’re going to create a special user that
doesn’t have regular login privileges, but does
belong to our newly created sftp_users group.
What you call that user is up to you. The command
for this is:
passwd USERNAME
4 of 7 05/10/2022, 15.15
How to set up an SFTP server on Linux | TechRepublic about:reader?url=https%3A%2F%2Fwww.techrepublic.com%2Farticl...
mkdir -p /data/USERNAME/upload
chown -R root:sftp_users
/data/USERNAME
chown -R USERNAME:sftp_users
/data/USERNAME/upload
Where USERNAME is the name of the new user
you created above.
Configure sshd
nano /etc/ssh/sshd_config
At the bottom of that file, add the following:
5 of 7 05/10/2022, 15.15
How to set up an SFTP server on Linux | TechRepublic about:reader?url=https%3A%2F%2Fwww.techrepublic.com%2Farticl...
Logging in
sftp USERNAME@SERVER_IP
Where USERNAME is the name of our new user
and SERVER_IP is the IP address of our SFTP
server. You will be prompted for USERNAME’s
password. Once you successfully authenticate, you
will be greeted with the sftp prompt. Type pwd to
check the working path and you should see /upload
(Figure A).
Figure A
6 of 7 05/10/2022, 15.15
How to set up an SFTP server on Linux | TechRepublic about:reader?url=https%3A%2F%2Fwww.techrepublic.com%2Farticl...
A simple solution
7 of 7 05/10/2022, 15.15