Friday, 6 July 2012

VSFTPD – Creating Virtual Users on Linux

VSFTPD – Creating Virtual Users on Linux 

Virtual Users means, there is no need to create system users or physical user accounts, users can be maintained using htpasswd. Using virtual users, they can get access to same ftp files via Apache.

Download and Install pam-pam_pwdfile from here.

# wget

# rpm -ivh pam-pam_pwdfile-0.99-2.i386.rpm

Now, append following lines to /etc/pam.d/vsftpd.pwd.

# vim /etc/pam.d/vsftpd.pwd

auth required item = user sense = deny file = /etc/vsftpd/ftpusers onerr = succeed

auth required pwdfile /etc/vsftpd/vsftpd_pwdfile

# pam_pwdfile doesn’t come with account, so we just permit, on success:

account required

Save and exit the file.

Now configure FTP configuration file,

# vim /etc/vsftpd/vsftpd.conf

# we’re running standalone

listen = YES

# enable virtual users:

anonymous_enable = NO

local_enable = YES

guest_enable = YES

# Where the accounts are located..

guest_username = ftp

user_sub_token = $USER

local_root = /home/LinuxFTP/store/$USER

chroot_local_user = YES

# allow writing

write_enable = YES

local_umask = 022

virtual_use_local_privs = YES

# some general options

dirmessage_enable = YES

hide_ids = YES

connect_from_port_20 = YES

# here we define OUR pam config [see above]

pam_service_name = vsftpd.pwd

# more verbose logging

xferlog_enable = YES

log_ftp_protocol = YES

setproctitle_enable = YES


ftpd_banner = “Welcome to”

Save and exit the file.

Restart FTP service and make it available across reboot.

# service vsftpd restart ; chkconfig vsftpd on

Finally, create new password file & user.

# htpasswd -c -b /etc/vsftpd/vsftpd_pwdfile username password

1 comment:

  1. Is it possible to make it on the AIX?


Twitter Bird Gadget