Gossamer Forum
Home : General : Internet Technologies :

Run a script each time someone logs in...

Quote Reply
Run a script each time someone logs in...
Hi. Is it possible to call a script when someone logs into SSH/FTP? I would need to preferably grab the IP, username, and time (I know how to do this).

Is this even possible?... and if so, does anyone have any pointers?

This is on a dedicated server, so I have root access.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Run a script each time someone logs in... In reply to
If you want to collect inform when they login then, depending on shell, usually a .bashrc in their ~ home directory will do. This will run upon succesful login. There is also site-wide login scripts available in /etc/bashrc or again, whatever shell you're using.

Read the man pages for your shell?

FTP? I have no idea.

- wil
Quote Reply
Re: [Andy] Run a script each time someone logs in... In reply to
If all you want is the ip, username and time, then that's stored in the logs. You can access that usually by the `last` command to get ssh logins. FTP you'll need yo look at your ftp log files.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Run a script each time someone logs in... In reply to
Thanks Alex/Wil.. I'll take a look at that :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!