Skip to content
  • Home
  • About
  • Contact

How To Tutorials

PHP, ASP, .Net, Linux, SEO

ftp

Linux: How to create ftp user?

May 23, 2014January 28, 2016Ananda Raj Pandey4 Comments

How add ftp users to folder or Apache server?

In this example we will create ftp group , ftp user and add it to the new or existing folder for ftp.

 

Step 1: If we already have group then we can skip this or lets start by creating a group, and lets call it ftpgroup

$ groupadd ftpgroup

 

Step 2: Create a user called ftpuser and add it to the group and also assign it with the folder. If folder is not assign default folder will be assigned which is normally /home/username

$ useradd userftp -p your-password -g ftpgroup -d /home/ftpfolder -s /bin/false

Normally ftp users dont need shell access so -s /bin/false.

 

Step 3:  Set ownership.

chown ftpuser:ftpgroup /home/ftpuser

And you are done.

 

If we need more user to be added to already existing ftp folder then we can do as follows:

 

Add new user to existing ftp group:

$   useradd newftpuser -p your-password -g gtpgroup -d /home/ftpfolder -s bin/false

Note: we can modify user anytime with the usermod eg:

$ usermod - d /home/differentlocation

 

When we add new user to the group,  we need to logout and login to the system, otherwise new user will not able to do ftp.  If we dont want to logout/login then we can run following command to the folder.

chmod -R ugo+rw /home/ftpfolder

 

Extra: Limiting ftp users to their permitted folders:

To limit ftp users not able to go to top level folder we can do..sdfsdfdsf

if  ftp server is vsftpd then make you have following un -commented or set.

vi /etc/vsftpd/vsftpd.conf

set :

chroot_local_user = yes
local_enable = Yes

 

and don’t forget to restart

service vsftpd restart

 

FTP users for web server like Apache:

If you are creating ftp for web users then make user user group is also apache else files uploaded by users will not be run by apache. So we can add multiple group to the users as follows:

 

usermod -a -G apache,group2 ftpuser

 

This step should work, but still you may not able to edit/create files because
When adding a user to a new group, that won’t be applied in any currently-running processes, only new ones. You need to log out and then log back in.
To fix this you can either logout and login or do the following command for your directory.

 chmod -R ugo+rw sit3

this will give access to the group / user to read /write to the folder.

 

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Pocket
  • Pinterest
  • Tumblr
  • Reddit
  • Print

Like this:

Like Loading...
apache, Linuxadd multiple ftp, Apache, ftp, User ftp create account

Categories

  • apache (15)
  • AWS (3)
    • S3 (1)
  • Classic ASP (1)
  • Cloud (2)
  • Cpanel (4)
  • Elasticsearch (2)
  • git (2)
  • Jquery (1)
  • Linux (34)
  • MsSql (2)
  • Munin (3)
  • Mysql (10)
  • Nginx (2)
  • PHP (7)
  • postfix (3)
  • Security (8)
  • SEO (1)
  • Server Optimization (13)
  • Uncategorized (13)
  • virtualmin (5)
March 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Feb    

Recent Posts

  • AWS: Mount S3 to Ec2 instances
  • postfix : how to prevent open relay?
  • Elasticsearch: FORBIDDEN/12/index read-only / allow delete (api) error
  • AWS: CloudFront 502 bad gateway error
  • AWS: CloudFront 504 timeout error

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 405 other subscribers

Tags

ananda raj pandey Apache centos Linux Munin Mysql Mysql optimization Nginx Server virtualmin
Blog at WordPress.com.
  • Follow Following
    • How To Tutorials
    • Join 57 other followers
    • Already have a WordPress.com account? Log in now.
    • How To Tutorials
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: