Changing the (what is it called?)
Hi,
I just set up a debian (sarge) box, and now after every time I log in,ever line starts with: Quote:
Regards, Freakin'me |
hostname
hostname
/etc/hostname |
Thanks for your quick reply.
However, when I enter /etc/hostname, the only thing I see is "debian". I used this tutorial to set everything up: http://www.falkotimme.com/howtos/per...arge/index.php , I think one of the software has changed something, but I don't know what it was/is. Regards, Freakin'me |
I think you're after the "prompt."
If that is the case, then an environment variable needs to be changed/modified/updated. The actual name of the environment variable depends on the shell you use. For bash, it's PS1. For tcsh, I believe it's prompt. I'm not sure what other shells use (such as ksh, zsh, etc). Bash is popular, so I'll assume you have that one. You can experiment with new prompts directly at the command line. For example: Code:
export PS1='\u@\h:\w\$' THe '$' or '#' at the end of the prompt indicates whether the user is a regular user or root; only root sees the '#' at the end. The prompt may look like this after the change: Code:
chris@deimos:~$ EDIT: Forgot to mention, to make the change permanent, the export line above either needs to be put in /etc/profile or included in the user's ${HOME}/.bash_profile. |
Thank you, that's exactly what I was looking for. However: My prompt is now: root@65.98.38.210:/etc/networking#
How do I change the 65.98.38.210 into serverdownstairs.lan? Regards, Freakin'me |
Quote:
|
## Hostname stuff
I don't use debian, so I can only make educated guesses. The man page for bash says the '\h' code gets "the hostname up to the first `.'" For this one, SirSlappy was right on the mark. Use the hostname command to change your hostname, or put the desired hostname in /etc/hostname. If that doesn't work, then you may need to look at the documentation for system startup to find how the hostname is set. Some distributions (like Red Hat) will keep the desired hostname in a different file, and execute "hostname <contents of other file>" on boot. Debian might do something similar. ## Global/personal prompt Applying to all users is done by adding it to /etc/profile. That file is automatically read by bash when it starts up. It gives the administrator the opportunity to set up default settings (such as the prompt). The ${HOME}/.bash_profile is user specific. Keep in mind, you can't force users to use the prompt. They can override it with their own version in their personal .bash_profile. |
Thanks for your reply.
My /etc/hostnames still contains nothing but "debian", so anybody who knows where debian (sarge) stores the hostname stuff? |
After a reboot my prompt is again just debian$: or something like that. However, when I boot, postfix gives an error about the fact that 65.98.38.210 is a numeric hostname.....
I can remember that I got during the installation of postfix a notice that the hostname I'd use for postfix whould also be used for other apps. |
All times are GMT -5. The time now is 04:12 PM. |