It’s not a bad idea to also check to make sure that the folder above it is owned by “root” or your primary user, which will prevent your new USER from being able to make changes to that folder. If you navigate to that folder and check the settings, you should see that the owner is now the USER and the GROUPNAME (you can check with “ls -l”). We should also make sure the permissions for the new folder are what we want them to be – read/write for the user and group: Sudo chown USER:GROUPNAME /var/sftp/NEWFOLDER First, let’s give ownership of that folder to the user with the chown command: Now, we need to tell the server to restrict USER to this NEWFOLDER when they login. Sudo mkdir -p /var/web/DOMAIN/public/wp-content/uploads/NEWFOLDER I put mine in a subfolder on their wordpress installation: This folder can be anywhere on your server. You can create a directory the user can use: In particular, we want the user to have access to just a single directory. Of course, the next step is to restrict what your new USER can do. So, you have now created a new group and a new user and added the new user to the new group. Then add your USER to your GROUPNAME with the following command: Replace “USER” with whatever name you’re using for this individual, for me it was “sharon.” You’ll need to create a password for your USER and fill in some additional information. If this individual isn’t currently a user on your server, add them as a user as well: This will add a new user group called GROUPNAME (I called mine “ftpusers”). This can be done with the following command: So, I was faced with the question of how to set up an FTP/SFTP account for someone that is restricted to just one folder – a folder where she can upload stuff and delete files, but with no access to anything else.įirst, you should create a new user group on your server. However, I don’t want a novice to gain access to all the files on my server. But I explained it and, hopefully, she’ll grow more comfortable with it. She was worried as she doesn’t know what that is or how to use it. I explained to this person, we’ll call her Sharon, that it would be possible for her to upload these files herself using FTP/SFTP. I can do so using SSH, but GUI FTP/SFTP software was going to be easier in this situation as the person responsible for managing that site doesn’t have a lot of knowledge managing a website. As a result, for certain types of files, it is now required to upload them using a different approach. I do, however, host one for a colleague who actively develops online content for that site.Īs WordPress has developed, the ability to upload various file types has slowly been removed for security reasons. Most of the sites are run using WordPress and are my own or sites I manage for friends or family. how to upload a file right?įor example, suppose I have in my Home a file called video.I run a server (Ubuntu 18.04) that hosts about a dozen websites using Linode. The question (and some wonder) I imagine is. hehe, if they write help in the FTP shell they get commands that they can use: There are many more commands, for example: Now is where we write the commands in this new shell which is the ftp shell, for example to list we use the command ls We put the ftp command and followed by it the IP address (or host) of the FTP server we want to connect to and that's it, for example:Īs shown in the image below, the user will ask us, we write it and press Enter, then it will ask us for the password, we write it and press Enter, ready we go! To work with an FTP server, a single command is enough: But how to do this from the command line?Įspecially when we work on a server and we do not have a GUI, we need to upload a file to an FTP or simply delete something, create a folder, etc, do anything and we only have our terminal, nothing else. To upload, download or manage the content of an FTP we have endless graphic applications, Filezilla is one of the most popular.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |