Skip to main content

How To Set Up vsftpd on Ubuntu

How To Set Up vsftpd on Ubuntu

Step One—Install vsftpd

You can quickly install vsftpd on your virtual private server in the command line:
sudo apt-get install vsftpd
Once the file finishes downloading, the VSFTP will be on your droplet. Generally speaking, it is already configured with a reasonable amount of security. However, it does provide access on your VPS to anonymous users.

Step Two—Configure vsftpd

Once vsftpd is installed, you can adjust the configuration.
Open up the configuration file:
sudo nano /etc/vsftpd.conf
The biggest change you need to make is to switch the Anonymous_enable from YES to NO:
anonymous_enable=NO
Prior to this change, vsftpd allowed anonymous, unidentified users to access the server's files. This is useful if you are seeking to distribute information widely, but may be considered a serious security issue in most other cases.
After that, uncomment the local_enable option, changing it to yes and, additionally, allow the user to write to the directory.
local_enable=YES
write_enable=YES
Finish up by uncommenting command to chroot_local_user. When this line is set to Yes, all the local users will be jailed within their chroot and will be denied access to any other part of the server.
chroot_local_user=YES
Save and Exit that file.
Because of a recent vsftpd upgrade, vsftpd is "refusing to run with writable root inside chroot". A handy way to address this issue to is to take the following steps:
  1. Create a new directory within the user's home directory
  2. mkdir /home/username/files
  3. Change the ownership of that file to root
  4. chown root:root /home/username
  5. Make all necessary changes within the "files" subdirectory
Then, as always, restart:
 sudo service vsftpd restart

Step Three—Access the FTP server

Once you have installed the FTP server and configured it to your liking, you can now access it.
You can reach an FTP server in the browser by typing the domain name into the address bar and logging in with the appropriate ID. Keep in mind, you will only be able to access the user's home directory.
ftp://example.com
Alternatively, you can reach the FTP server on your virtual server through the command line by typing:
 ftp example.com
Then you can use the word, "exit," to get out of the FTP shell.

Comments

Popular posts from this blog

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy' solution this solved the issue sudo npm install -g ios-deploy -unsafe-perm

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy' solution this solved the issue sudo npm install -g ios-deploy -unsafe-perm

How to revoke code from github?

How to revoke code from github? https://stackoverflow.com/questions/6655052/is-there-a-way-to-rollback-my-last-push-to-git Since you are the only user: git reset --hard HEAD@{1} git push -f git reset --hard HEAD@{1} ( basically, go back one commit, force push to the repo, then go back again - remove the last step if you don't care about the commit ) Without doing any changes to your local repo, you can also do something like: git push -f origin <sha_of_previous_commit>:master

preg expression regular expression details and introduction

preg expression regular expression details and introduction Useful regex examples Reference: http://www.catswhocode.com/blog/15-php-regular-expressions-for-web-developers REGULAR EXPRESSIONS SYNTAX Regular Expression Will match… foo The string “foo” ^foo “foo” at the start of a string foo$ “foo” at the end of a string ^foo$ “foo” when it is alone on a string [abc] a, b, or c [a-z] Any lowercase letter [^A-Z] Any character that is not a uppercase letter (gif|jpg) Matches either “gif” or “jpg” [a-z]+ One or more lowercase letters [0-9.-] Аny number, dot, or minus sign ^[a-zA-Z0-9_]{1,}$ Any word of at least one letter, number or _ ([wx])([yz]) wy, wz, xy, or xz [^A-Za-z0-9] Any symbol (not a number or a letter) ([A-Z]{3}|[0-9]{4}) Matches three letters or four numbers PHP REGULAR EXPRESSION FUNCTIONS Function Description preg_match() The preg_match() function searches string for pattern, returning true if pattern exists, and false otherwise. preg_match_