Rackspace Cloud Essentials - CentOS - Configuring a user in vsftpd


In the last article, CentOS - Installing vsftpd, we walked through setting up a working install of vsftpd. This article will be fairly short, we're going to walk through creating a system user and chrooting (jail - isolation to their home directory) them if necessary.


Contents

Add your system User

Yes, it is this simple, creating a new user for ftp access in vsftpd is as easy as creating a new valid linux system user.

    # useradd test
    # passwd test

Disable SSH access for FTP users

The default user creation script will give a user the /bin/bash shell, which can be a little too powerful. If you don't want your users logging into your server via SSH, we need to know how to block this access. If you change the shell to /bin/false, the users will only be able to login via ftp or mail if you have that setup. Here is how to modify your users:

usermod -s /sbin/nologin test

Chroot a user

Alright and probably the most important part of this article is the ability to lock a user down to their own home directory so they don't go around mucking with things they aren't supposed to. The beauty of this is it is a function built in to vsftpd and was covered in the Installing vsftpd article. When a user logs in they will be unable to move 'up' a level in the directory structure.

That pretty much covers it for vsftpd, and at this point you should be able to create a new system user, set them up for vsftpd and do some basic tweaks to their access level.  These last two articles dealt with vsftpd in a CentOS Linux system.  Now we will show you how to install vsftpd on a server running Ubuntu.



Was this content helpful?




© 2014 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER