The power!!!! [getting your Free-BSD installation up and running as FTP & Telnet server]
Yeah well its me again and BSD is taking over slowly and surely. Well this week I got the 101 kids and compilers kids doing labs. lisp, prolog, lex, yacc, over my BSD machine via telnet and ftp. It was so fun. The 101 kids were running 80+ telnet sessions in total and it really cut down the hassle of installing everything on 80 machines because lisp and prolog were only going to be covered in one lab. Anyways here's how I setup everything.
Take PC-BSD / Free-BSD installation. <-- Check out elsewhere on installation tips.
Once its installed, open the console and type in sysinstall and hit enter. This should bring up a utility. Under configuration, hit Network and there enable inetd.
It will also spring up the file from /etc/inetd.conf up for editing. Uncomment the lines for ftp and telnet. [Note telnet is not secure but I used it due to fact that I'm in a trusted environment and they're windows machines everywhere].
You're good to go. Telnet should be operational. In case its not, you can make sure that the packet filter is disabled:-
Iqbal# pfctl -d
pfctl: pf not enabled
In case you want to leave it enabled, go into /etc/pf.conf and configure it.
Once your ftp and telnet servers are up and running, you have to look at user convinience. Install nano, pico and the like (bleh!!!!) from the ports collection. You can get precompiled binaries with the extension .tbz and all you have to do is run them with pkg_install
Once this is done, you're up and ready to go. Well not really. I had to make accounts for my users/students which required some perl scripting. Good old perl eh. :P
use strict;
## create accounts for user_1 .. user_300
for my $n ( 1..80 ) {
#Phase 1
system('pw', 'useradd', "101-$n", '-d', '', "/usr/home/101kids/101-$n");
#phase 2
system('passwd', "101-$n");
#phase 3
system('mkdir', "/usr/home/101kids/101-$n");
#phase 4
system('chown', "101-$n", "/usr/home/101kids/101-$n");
#phase 5 pw usermod 101-1 -d /home/101kids/101-1
system('pw', 'usermod', "101-$n", '-d', "/usr/home/101kids/101-$n");
#phase 6
#system('rmuser', "101-$n");
}
Well theres the magic for you. Uncomment the lines you need. Phase 6 is for undoing everything. passwd will ask for a password everytime. I just held the enter key. I could assume that everyone would change his password on first logon.
Plus you can also use the following line in the loop to throw some examples and stuff in.
#system('cp', 'knowledge.pl', "/usr/home/101kids/101-$n/grandfather.pl");
Remember to also give ownership to the files you copy as root as follows:-
#system('chown', "101-$n", "/usr/home/101kids/101-$n/grandfather.pl");
I just cant wait till the weekend when I shall delete the folders of 22 compiler kids + 160 101 kids work. Which means 3.5 hours each which all amounts to 637 hours. This shall be fun indeed.
Take PC-BSD / Free-BSD installation. <-- Check out elsewhere on installation tips.
Once its installed, open the console and type in sysinstall and hit enter. This should bring up a utility. Under configuration, hit Network and there enable inetd.
It will also spring up the file from /etc/inetd.conf up for editing. Uncomment the lines for ftp and telnet. [Note telnet is not secure but I used it due to fact that I'm in a trusted environment and they're windows machines everywhere].
You're good to go. Telnet should be operational. In case its not, you can make sure that the packet filter is disabled:-
Iqbal# pfctl -d
pfctl: pf not enabled
In case you want to leave it enabled, go into /etc/pf.conf and configure it.
Once your ftp and telnet servers are up and running, you have to look at user convinience. Install nano, pico and the like (bleh!!!!) from the ports collection. You can get precompiled binaries with the extension .tbz and all you have to do is run them with pkg_install
Once this is done, you're up and ready to go. Well not really. I had to make accounts for my users/students which required some perl scripting. Good old perl eh. :P
use strict;
## create accounts for user_1 .. user_300
for my $n ( 1..80 ) {
#Phase 1
system('pw', 'useradd', "101-$n", '-d', '', "/usr/home/101kids/101-$n");
#phase 2
system('passwd', "101-$n");
#phase 3
system('mkdir', "/usr/home/101kids/101-$n");
#phase 4
system('chown', "101-$n", "/usr/home/101kids/101-$n");
#phase 5 pw usermod 101-1 -d /home/101kids/101-1
system('pw', 'usermod', "101-$n", '-d', "/usr/home/101kids/101-$n");
#phase 6
#system('rmuser', "101-$n");
}
Well theres the magic for you. Uncomment the lines you need. Phase 6 is for undoing everything. passwd will ask for a password everytime. I just held the enter key. I could assume that everyone would change his password on first logon.
Plus you can also use the following line in the loop to throw some examples and stuff in.
#system('cp', 'knowledge.pl', "/usr/home/101kids/101-$n/grandfather.pl");
Remember to also give ownership to the files you copy as root as follows:-
#system('chown', "101-$n", "/usr/home/101kids/101-$n/grandfather.pl");
I just cant wait till the weekend when I shall delete the folders of 22 compiler kids + 160 101 kids work. Which means 3.5 hours each which all amounts to 637 hours. This shall be fun indeed.