For any company looking to offer staff and clients a simple, secure means of uploading and downloading files, this is a not only a great solution but also very budget friendly one. That’s all there is to setting up an SFTP server on Linux. Type pwd to check the working path and you should see /upload ( Figure A). Once you successfully authenticate, you will be greeted with the sftp prompt. You will be prompted for USERNAME’s password. Sftp USERNAME is the name of our new user and SERVER_IP is the IP address of our SFTP server. From another machine on your network that has SSH installed, open up a terminal window and issue the command: Open up the SSH daemon configuration file with the command:Īt the bottom of that file, add the following: Where USERNAME is the name of the new user you created above. This is handled with the following commands:Ĭhown -R USERNAME:sftp_users /data/USERNAME/upload Now we’re going to create an upload directory, specific to the new user, and then give the directory the proper permissions. Where USERNAME is the name of the user created above. To set up the password, issue the command: This password will be the password the new users use to log in with the sftp command. Useradd -g sftp_users -d /upload -s /sbin/nologin USERNAME 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. Now we’re going to create a special group for SFTP users. Open up a terminal window, su to the root user (type su and then, when prompted, type the root user password), and then issue the following two commands:Ĭhmod 701 /data Create the SFTP group and user The first thing we must do is create a directory that will house our FTP data. Once you’ve procured that access, it’s time to make this work. What you must have, however, is access to an account with admin rights. I’ll be using CentOS 7 as my platform, but this process will work on any Linux distribution.Īs I mentioned, CentOS 7 already has everything you need, out of the box. Once you know how to do this, you can create as many users as you need. I’ll demonstrate by creating a single user that is limited to only SFTP logins. I’m going to walk you through the process of setting up an SFTP server. There is, however, a slight bit of work to be done to get this configured. With CentOS 7, there’s no third party software to install to make this work–everything is installed out of the box. If you aren’t sure about SFTP, it is the FTP service built into Secure Shell (SSH), which allows users to securely push and pull files to and from the server, using SSH. Take, for instance, the ability to easily configure CentOS 7 to work as an SFTP server. And, if it isn’t ready out of the box, you can make it so. Whatever task you throw at the server, it will be ready. For more info, visit our Terms of Use page.Įditor’s note: The article was edited to correct username conventions within the commands.ĬentOS 7 or any Linux server distribution is a very powerful server that performs above and beyond what your business might need. This may influence how and where their products appear on our site, but vendors cannot pay to influence the content of our reviews. We may be compensated by vendors who appear on this page through methods such as affiliate links or sponsored partnerships. These steps walk you through the process of setting up an SFTP server on Linux for the secure transfer of files for specialized file transfer-only users.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |