[wplug] setting hostname
Drew from Zhrodague
drew at zhrodague.net
Thu Jan 15 13:14:05 EST 2004
> 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.
The domain name and hostnames are usually different, and should be
treated as such. A fully qualified domain name reads as host.domain.com.
The proper way to do this, is to simply change the hostname. On
Redhat systems, the hostname is set in /etc/sysconfig/network. On other
systems, it can be /etc/HOSTNAME, or /etc/hostname, or it can be set in a
different place. You can use the hostname command to change the hostname,
but you'll have to logout and login to see that change.
If you have a system that already has a hostname, but you want it
to appear differently, editing /etc/profile, and setting the hostname in
there will make it appear like the host is different. Like someone else
said, you can edit the /home/user/.bashrc or .bash_profile to lie to the
user about the hostname.
You can also edit files in /etc/skel/ (like .bash_profile or
.bashrc) to again lie to the user about the hostname.
The domain name is set in /etc/resolv.conf -- you should have a
line which says:
domain something.com
Good luck!
--
Drew from Zhrodague http://www.WiFiMaps.com
drew at zhrodague.net Location Based WiFi
More information about the wplug
mailing list