View Single Post
  #1   (View Single Post)  
Old 26th June 2008
EvilMonkeySlayer EvilMonkeySlayer is offline
New User
 
Join Date: Jun 2008
Posts: 3
Default Automatic launching of a script upon login. Help me figure this out

Okay, i've been mulling about an idea ever since I got works new FTP server up and running.

Currently, here's how it works:

I have the ftp server running with virtual users as a security precaution, this is running pure-ftpd on top of OpenBSD. At the moment all user management is done by me, so creation, modifying etc. All me.

I've had an idea to both make my life a bit more simpler and possibly offload the work to someone else. I have seen in the past that upon login on a console a bash script (or some kind of shell script) can run upon immediate login.

My plan is to create an interactive script that can create, modify and delete users purely from simple selections, for example this would appear upon connection:

Quote:
Welcome to the bla FTP server, please make your selection:

1) Create user
2) Modify user
3) Delete user
4) Logout
Upon entering a number and pressing enter it goes through further menus to do this like change passwords, entering user names etc. (essentially the script passes the commands like "pure-pw useradd %username% -u ftpuser -d %homedir%")

Here's my plan as I see it, I need to do the following:
  • Figure out how to do automatic login via putty with public/private key authentication (this is especially important if I offload the work to someone else)
  • Create a (super?)user specifically for this task, I don't want it to have full root capabilities. Just enough for pure-ftpd.
  • Learn a command line scripting language
  • Figure out how to get it to launch the script immediately upon connection (set the script as the shell?)
  • Disable users ability to ctrl-c out, if they ctrl-c I don't want it going to the command line but to immediately logout. In other words no shell access.

I'm open to suggestions on how to approach this. Any ideas on what I should be reading up on?

I believe I have now got the auto-login with putty figured out. By leaving out the pass phrase (from puttygen) I can get it to auto-login with putty.

This is a very base OpenBSD 4.3 install, all i've got installed is pure-ftpd and nano. (I cannot stand ed, vi or any of the other remember 27 million key combinations programs)

I posted this to bsdforums before realising it was a walking corpse intent on spewing spam.
Reply With Quote