SubDomains & FTP Accounts

philmcdonnell

Verified User
Joined
Jan 6, 2004
Messages
184
Location
New York
Hello,

I have a domain with a subdomain assigned.

I want to allow users to ftp into the subdomain but not the domain, how do I setup individual users to ftp into their own folders inside the subdomain?

I have a school that has their own domain for the school and they want to allow students to make webpages and ftp them to the schools subdomain students.domain.com is this possible?

Thanks,
Phil
 
There are better solutions but just off the top of my head. My first thought would be to create a new Reseller (who would be teacher, admin, class). Then assign the limits as you would for a reseller. Now as the reseller each student gets a account (create user). When you create a user who cares what the domains is you could make it username.domain.com. The important part is the username this is what will follow the ~.

Now you have all the features of each domain (some advanced people could use MySQL or have php or cgi) as well as bandwidth limits.

Now to access the site it would be:

http://students.domain.com/~username/

Its kinda a hack of DirectAdmin. If it was my job that is how I think I would do it.
 
Last edited:
existenz said:
There are better solutions but just off the top of my head. My first thought would be to create a new Reseller (who would be teacher, admin, class). Then assign the limits as you would for a reseller. Now as the reseller each student gets a account (create user). When you create a user who cares what the domains is you could make it username.domain.com. The important part is the username this is what will follow the ~.

Now you have all the features of each domain (some advanced people could use MySQL or have php or cgi) as well as bandwidth limits.

Now to access the site it would be:

http://students.domain.com/~username/

Its kinda a hack of DirectAdmin. If it was my job that is how I think I would do it.

Wow!!! This is way more than I want. I just want to be able to allow the admin to make ftp account into a directory not give accounts out to students. I don't want them having email, etc...

Any other ideas? I was thinking of creating the subdomain as a real domain and adding ftp accounts that way?? Possible?

Phil
 
It can be simple:

As admin create a new reseller package students
Everything 0 or unchecked except:
-Bandwidth (set or unlim)
-Disk Space (set or unlim)
-FTP Accounts (1)

As admin create a reseller:
The only difference is:
-Domain (students.domain.com_
-Package (students)

Now login as your new reseller. Add a new users as you wish. You can ignor all the options since you don't need them. All you need set is:
username: (it will be students.domain.com/~username)
passwords:

Now they can all login to their own space. You can delete them, add, change etc.

I can't figure out a better way for you situation.
 
Erm... couldn't you just set up a normal user account for the whole school site, and then create and FTP account for each student, each with their own directory (and limited only to that directory)?

HTH,
Matt
 
thoroughfare said:
Erm... couldn't you just set up a normal user account for the whole school site, and then create and FTP account for each student, each with their own directory (and limited only to that directory)?

HTH,
Matt

Certainly could, and would take only a few seconds to setup :)

Chris
 
thoroughfare said:
Erm... couldn't you just set up a normal user account for the whole school site, and then create and FTP account for each student, each with their own directory (and limited only to that directory)?

HTH,
Matt

This is what I am trying to do. How can I get seperate FTP accounts to all point to my subdomain directory?

I need to be able to access the webpages like this...

subdomain.domain.com/studentsname

I setup a subdomain already which point to a folder in my public_html called students. I can't figure out how to make ftp accounts for each student point to their individual folders inside the students folder.

Phil
 
Posted by John in the skins thread, think you need to create the user as a shell user with no access firstly :)

Hello,

The only way to set that up (a bit weary about doing it) is to add the username to the /etc/proftpd.passwd file.

1) find the UID and GID #'s for "diradmin"
Code:
id diradmin

2) run this:
Code:
echo "directadminskins:cryptedpass:UID:GID:comments:/usr/local/directadmin/data/skins:/bin/false" >> /etc/proftpd.passwd

replace UID and GID with the numbers found in step 1.
replace crytpedpass with a password of your chosing:
PHP:
[server]#  php
<?
echo crypt("password","randomcharacters")."\n";
?>
press ctrl-D twice to finish. The generated text will be the crypted password.

Then just login as directadminskins to the server IP with "password" and you should be sitting in the skins directory.

John

Chris
 
Since it appears I can't do what I want easily, couldn't I do one of two things?

1-setup the domain with the subdomain already as one so that all users will be under th full subdomain.domain.com?

2-Just add to the apache directives to allow subdomain.domain.com to go to the domain.com virtual host?

I can't believe this is so hard...

Phil
 
Hi,

It's really very simple...

1. set up a subdomain called 'students'
2. if you FTP to your account, you'll find a directory called 'students' under public_html
3. create a directory for each student under the 'students' directory
4. create an FTP account for each student, limiting their access to their directly only.

There you go... students.domainhere.com/studentnamehere

Done!
If you work it right, you could use PHP and the DA API to automate the create of the FTP accounts and directories by connecting to a student database with PHP.

HTH,
Matt
 
Hello,

Just create their ftp accounts as type "User":

User: * Ftp account with the root directory as the users name in the public_html directory

This will automatically limit them to ..../public_html/username

John
 
DirectAdmin Support said:
Hello,

Just create their ftp accounts as type "User":



This will automatically limit them to ..../public_html/username

John

I know that already, I am trying to limit them to a subdomain not just their user folder.

I have a subdomain that points to a folder in the public_html, this is how DA works correct?

I need to add users to that folder and only give them access to their folder is this possible or not?

Thanks,
Phil
 
Yes!

Follow my instructions. Just go ahead and try it. It doesn't have to be so difficult...

Matt :)
 
Hello,

The link that I think you need is that

ftp = public_html/user
subdomain = public_html/user

are the same path. so bob.domain.com will point to public_html/bob.. and the ftp account [email protected] will point to public_html/bob. It's all the same place.

John
 
DirectAdmin Support said:
Hello,

The link that I think you need is that

ftp = public_html/user
subdomain = public_html/user

are the same path. so bob.domain.com will point to public_html/bob.. and the ftp account [email protected] will point to public_html/bob. It's all the same place.

John

Ok,

Maybe I am not explaining it correctly. Let me show you how I need it to work and you tell me if it can be done and how.

I have a real domain:

domain.com

This works fine.

Now I have a subdomain:

students.domain.com

This points to -> home/domain.com/students/

Am I correct so far?

Now I need to setup folders one more level deep

home/domain.com/students/studentname

I need seperate ftp accounts for all the studentname folders inside of the students folder which my subdomain points at.

Can this be done? Did I make myself clearer this time I hope?

Thanks for all your help..

Phil
 
Yes, it's very easy to do. Create a directory for every student under the 'student' directory. Then create an FTP account for every student, and limit each one to their own directory.

It works, trust me ;)

Matt :D
 
thoroughfare said:
Yes, it's very easy to do. Create a directory for every student under the 'student' directory. Then create an FTP account for every student, and limit each one to their own directory.

It works, trust me ;)

Matt :D

How do you limit each one to their own directory? This is my problem.......

Phil
 
It's in the FTP menu when you create a new account. There is a problem thinking about it, because the way the accounts are limited, they can only be directly under 'public_html'. And you need them under public_html/students.

Maybe if you add students.domain.com as a new 'domain' in the domain administration menu, and that might work.

Cheers,
Matt
 
Maybe if you add students.domain.com as a new 'domain' in the domain administration menu, and that might work.

Cheers,
Matt [/B]


UGH!!!! This is what I have been saying all along but nobody agreed that it would work..

Oh well back to trying.

Phil
 
Back
Top