Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Apr 11, 2011 6:34 pm 
Offline
Newbie

Joined: Mon Apr 11, 2011 3:37 pm
Posts: 2
Location: Burnaby, BC, Canada
Overview
I have never had my own VPS, but I need a website where I can create a lot of FTP accounts for students so they can upload assignments to their own folders.

Background
I am a Linux newb, though I use Solaris and Mac OSX command line stuff all the time for work. No heavy lifting, more just moving, downloading, installing things but I've never set up Apache or an FTP program.

I teach an Intro to Web Development program at a school that has no web space for students. Historically I have done this on a shared web host using cPanel. I go in, create an FTP account for each student, which then creates a space on the filesystem for that student. Usually something like:

www.thewebsite.com/students/{firstnamelastname}

This worked perfectly until the hosting company I am with suddenly changed their setup so they only allowed 5 concurrent FTP connections from 1 IP address. The problem is that I have a class of 60 students all trying to get their index.html file to work. The lab I am in routes all traffic through a single IP.

I have 3 other instructors who also teach similar classes (getting started with CSS, getting started with JS, etc), so I need to make sure that creating FTP Accounts for students is a simple process.

What I need
  • An easy (preferably GUI) way to create FTP accounts that will provision a folder when the account is created. No one is going to be happy if there is a lot of work involved in creating 180 new accounts every single term.
  • Up to 60 simultaneous FTP connections to the server from a single IP source. This seems to be a restriction on most shared accounts, but not on VPS accounts.
  • I also need SSIs and PHP installed for some minor projects we do in week 9 and 10.

The big question
Is this something I can set up on Linode? Is this hard? Will it require a lot of upkeep? I'm not very experienced but I learn pretty quickly.

A note about FTP over other technologies
I use FTP with students, despite the fact that it's a security nightmare, because it is easy to understand and believe me, for the students I am getting it needs to stay easy. They all use Filezilla, so I guess I could do SFTP, but can you set up accounts in the same manner?


Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 7:12 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Check out any number of guides for virtual hosting with ftp and mysql.

Then whip up a quick php script to batch add people to the database from something like a csv file.


Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 7:33 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
I've had good luck with vsftpd in terms of managing legacy web folder access, and specifically in terms of "virtual" accounts that need not exist on the target system, but are still limited in filesystem access. Given how you are using this strictly for storage I'd think a "virtual" user setup would work well. Certainly there won't be any limits on numbers of sessions (simultaneous, from given source addresses or otherwise).

While I don't know if there is any GUI, the process and information to create for a new user is pretty simple, and could easily be scripted or a quick 'n dirty web page put up.

Once set up, to create users, you just need to:
  1. Add a line to the virtual user password file
  2. Create some local directory for that account to use
  3. Add a config file for the user to set vsftpd to lock the user to that directory (can be avoided if the directory will match the user name)
I did the following on my system to set up the above scenario. First, the basic vsftpd.conf looked like:
Code:
ftpd_banner=XXXX.com FTP server
anonymous_enable=NO
local_enable=YES
virtual_use_local_privs=YES
write_enable=YES
guest_enable=YES
guest_username=[USER]
chroot_local_user=YES
hide_ids=YES
user_config_dir=/etc/vsftpd/users

The [USER] entry is the actual system user that you wish the ftp users to act as when working with the local filesystem. So technically all files will be owned by the same system user, but each user is locked to their own respective directory anyway. Although one aspect of this is you can create an administrative account that is rooted right above all the per-user directories and can then access everything.

Of course, if you'd prefer you could create actual system accounts for each user, but since they'll never do anything but use ftp it seems more overhead than its worth.

To support password lookup without requiring an actual system user, I added a PAM configuration file to reference a separate password file for vsftpd.
Code:
# /etc/pam.d/vsftpd
auth      required      pam_pwdfile.so pwdfile /etc/vsftpd/passwd
account   required      pam_permit.so

The /etc/vsftpd/passwd file can be maintained with htpasswd from Apache, for example.

Now, in my case there wasn't always a clean mapping between user and directory, so I implemented per-user configuration files (in /etc/vsftpd/users via the user_config_dir setting) each of which had at least one configuration line setting local_root appropriately, as in:
Code:
# /etc/vsftpd/users/someuser
local_root=<somedirectory>

But if you can keep your directory names matching the account names, then vsftpd has some other options to make that easier by setting user_sub_token, and then assigning your dedicated "guest" user a home directory including that token, which then gets replaced with the virtual username.

So, for example, if user_sub_token was set to "$USER", and your guest user (say "student") has a home directory of /srv/students/$USER, then logging in with a virtual user of "fred" will lock that ftp session to the /srv/students/fred folder (which must already exist).

Hope that gives you some ideas.

-- David


Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 8:44 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Linode.com is a great VPS host (probably one of the best) - but unless you want to be a full time sysadmin instead of a teacher - you're probably waaaaaaaaaaaay better off using a reseller account on a shared host.

Otherwise, one clever student, and you're wasting hours debugging your VPS system, or just trashing every students work and starting fresh.

Get a reseller account on any one of the shared hosting services (I like Downtownhost - search for coupons online - cheap, good for shared hosting - decent support).

As the saying goes - why reinvent the wheel - stick with what worked before.


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 2:01 am 
Offline
Newbie

Joined: Mon Apr 11, 2011 3:37 pm
Posts: 2
Location: Burnaby, BC, Canada
vonskippy wrote:
Otherwise, one clever student, and you're wasting hours debugging your VPS system, or just trashing every students work and starting fresh.


That kind of hits the nail on the head. I am a fulltime faculty member and I simply have zero time for fussing around with a system.

vonskippy wrote:
Get a reseller account on any one of the shared hosting services


...and we're right back where I started. In all my searching, I have had a hard time finding a place that allows more than just a couple simultaneous ftp connections from a single IP. Same old same old every email or live-chat that I do.


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 5:06 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Get a managed vps? Or have someone manage your linode for you?

That way you get the best of both worlds, you get the vps you want and don't have to touch it.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 6:00 am 
Offline
Newbie

Joined: Mon Apr 11, 2011 1:18 pm
Posts: 3
I'm a bit lost, you are using ftp for easy usage?
Why not use a php upload script or html 5 drag and drop. This would seem like the easiest way. Let the user login to the page then allow them to upload files.

Example: http://www.plupload.com/
http://www.plupload.com/example_queuewidget.php


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 8:42 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 567
Website: http://www.mattnordhoff.com/
I am confused that SFTP has not been mentioned anywhere in this discussion...

http://www.43folders.com/2008/07/14/dump-ftp
http://library.linode.com/search?query=sftp

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 9:04 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
mnordhoff wrote:
I am confused that SFTP has not been mentioned anywhere in this discussion...


As far as I know, there's not a convenient solution for using sftp without actual user accounts on the system, and when he's swapping students with this much volume and frequency, I'd say that's a must.

Really, I don't see the need for managed in this case. Proftpd, virtual hosting with MySQL, a simple script on the server to turn a text file full of names into database entries, voila!

I'd recommend setting it up to serve FTPS, but even then, that just adds protection for your students.


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 11:35 am 
Offline
Senior Member

Joined: Sat Sep 25, 2010 2:25 am
Posts: 75
Website: http://www.ruchirablog.com
Location: Sri Lanka
Best way is get a linode with backup of course! And install Cpanel on it so you can still use cpanel and use linodes awesome resources!

Installing cpanel is easy as 123! Every noob can do it!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group