Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set up a ftp user in linux?

Status
Not open for further replies.

gchen

Programmer
Joined
Nov 14, 2002
Messages
174
Location
US
Hi,

My little linux box is connected to internet and i have been hosting some web sites that i created for families and friends. now i need to create ftp account for them to upload stuff. i do not want them to have telnet access though. is there a way to create account who has only ftp capability and log in to designated directory, say home/http/html/his_her_web_site/

Thank you all!

Gary
 
You should already have an ftp server that came prepackaged with your linux distro. You just have to make sure it starts at boot up. The one that comes with most distros is called vsftpd. Users will login using their system username and password. In most cases you will want them to be chrooted (jailed)to their home directory (usually the default). Make sure to change the user's home directory to their webspace if they are not the same. If you have a firewall, make sure ports 20 and 21 are both open and forwarded to the ip of the ftp server just as you did for the web server.
 
my ftp is on and i can ftp without a problem. what i have in question is can i create account who can only do ftp but not telnet. like verio, for its regular web host client, only ftp is possible. i am wondering if there is such ftp only user account under linux. thank you!
 
Technically, there is no such thing as an FTP-only class of user. But it is a simple matter to allow a user to connect by FTP but to not connect any other way.

Look in /etc/passwd. Each line in that file is the information for a user. Each line is separated into sections by colons.

The last section tells the system the default login shell to use when that user attempts to login at a console (at the keyboard or via telnet or ssh). On RedHat systems, this is typically /bin/bash by default.

If you change /bin/bash to /dev/null for a user, that user will not be able to perform a console login.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
If you don't want anybody to be able to tlenet in, you may think about shutting down the telnet server and disabling port 23. If you need it for admin of your server, I would use ssh instead which uses port 22. Then do as sleipnir214 says and deny them shell access by assigning /dev/null or /sbin/nologin or /bin/false as the shell. I just think a man should have some choices. :-)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top