[wplug] setting hostname

Ghataora, Hardeep hghataora at ccac.edu
Thu Jan 15 11:00:57 EST 2004


Dirty method.


Create a database of users and hosts:

e.g. /usr/local/etc/users.hosts

/joe/figlet/
/tony/ benji/
/bob/figlet/
/ron/ benji /
/fred/figlet/
/kevin/benji/


once created you can lookup the user against the host using
	grep `whoami` /usr/local/etc/users.hosts | cut -d / -f 3

yeah, it's dirty, sue me

H

-----Original Message-----
From: Henry Umansky [mailto:hmust2+ at pitt.edu] 
Sent: Thursday, January 15, 2004 8:59 AM
To: wplug at wplug.org
Subject: [wplug] setting hostname

Hello,
I have a server that is virtually hosting a few websites for my friends
and 
others.  I give everyone shell access with SSH and on the command line I

want the prompt to read "[username at hostname] $" where hostname is the 
virtual domain name they used to login.  So say friend 1 logins to
domain1 
and friend 2 logins to domain 2, I want the prompts to read 
"[friend1 at domain1]$" and "[friend2 at domain2]$" respectively.  Now of
course 
both of those domains resolve to the same IP address.  I was just
wondering 
if there was a way I can use sshd to figure out what hostname they typed
in 
and set HOSTNAME accordingly.  Maybe I'm not able to figure out that
with 
sshd, but if anyone has any ideas please let me know.  Thank you.

-Henry
_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug



More information about the wplug mailing list