bigjohn Posted March 17, 2003 Report Share Posted March 17, 2003 for some unknow reason, when I open a konsole, my hostname comes up as john@john@localhost john, so how do I change it please??? regards John Quote Link to comment Share on other sites More sharing options...
paul Posted March 17, 2003 Report Share Posted March 17, 2003 firstly it may not be your hostname hostname will return you complete hostname heres mine paul@trinity paul $ hostname trinity.loudas.com paul@trinity paul $ it could be your bash settings. Your bash prompt (PS1) should be set to something like this [33[01;32m]u@h [33[01;34m]W $ [33[00m] you can check by doing this echo $PS1 is it is radically different then change it like this export PS1=[33[01;32m]u@h [33[01;34m]W $ [33[00m] Quote Link to comment Share on other sites More sharing options...
paul Posted March 17, 2003 Report Share Posted March 17, 2003 incase it IS your hostname .. it can be changed permanently here: /etc/sysconfig/network example: [paul@dozer paul]$ cat /etc/sysconfig/network GATEWAYDEV=eth0 NETWORKING=yes FORWARD_IPV4=false HOSTNAME=dozer.loudas.com DOMAINNAME=loudas.com GATEWAY=192.168.1.1 then restart networking service network restart Quote Link to comment Share on other sites More sharing options...
Daveleh Posted March 17, 2003 Report Share Posted March 17, 2003 incase it IS your hostname .. it can be changed permanently here:/etc/sysconfig/network example: <!--QuoteEBegin--><!--QuoteEBegin-->[paul@dozer paul]$ cat /etc/sysconfig/network<!--QuoteEBegin--><!--QuoteEBegin-->GATEWAYDEV=eth0<!--QuoteEBegin--><!--QuoteEBegin-->NETWORKING=yes<!--QuoteEBegin--><!--QuoteEBegin-->FORWARD_IPV4=false<!--QuoteEBegin--><!--QuoteEBegin-->HOSTNAME=dozer.loudas.com<!--QuoteEBegin--><!--QuoteEBegin-->DOMAINNAME=loudas.com<!--QuoteEBegin--><!--QuoteEBegin-->GATEWAY=192.168.1.1<!--QuoteEBegin--><!--QuoteEBegin--> then restart networking service network restart Before I go and really screw things up :D I have my own domain name of lehuray.org.uk Can I use the above description to change the domain name setting to lehuray.org.uk , bearing in mind that I use a dialup connection and don't have an internal network, or will that create problems connecting etc? I already have my hostname set to daves-linux. Quote Link to comment Share on other sites More sharing options...
paul Posted March 17, 2003 Report Share Posted March 17, 2003 I think that may cause problems until recently my home network was called loudas.home (my domain is loudas.com) this worked quite well machinename.loudas.home did not interfere with loudas.com Quote Link to comment Share on other sites More sharing options...
bigjohn Posted March 18, 2003 Author Report Share Posted March 18, 2003 Sorry Paul but this is going to sound like im being really thick! But how do I change it again (i.e. what do i need to type in?) Because john@localhost.john is the host name but at the bash prompt it comes up as john@john@.localhost.john regards John Quote Link to comment Share on other sites More sharing options...
mtweidmann Posted March 18, 2003 Report Share Posted March 18, 2003 I don't know if this will help with your bash prompt, but you can chnange yuor hostname within Mandrake Control Centre. All you have to do is run the network setup wizard, and when it asks give the hostname of your choice. Quote Link to comment Share on other sites More sharing options...
paul Posted March 18, 2003 Report Share Posted March 18, 2003 type in this: export PS1=[33[01;32m]u@h [33[01;34m]W $ [33[00m] and see if it looks any better if it does .. then edit a file in your home directory called .bashrc and put that line in that file Quote Link to comment Share on other sites More sharing options...
aru Posted March 19, 2003 Report Share Posted March 19, 2003 type in this:export PS1=[33[01;32m]u@h [33[01;34m]W $ [33[00m] Oh my God!!! all that stuff for a test??? Do you want to scare bigjohn? :D :P wouldn't be simplier to test a: export PS1="u@h W $ " which is the same but w/o the colour complication Bigjohn, open a Konsole and type: ~$ export PS1="u@h W $ " (remember a $ prompt is for normal users input) if you get the same weird hostname, then follow paul advice about /etc/sysconfig/network; if not, then post here the content of the files: /etc/bashrc /home/john/.bashrc and we'll try to help you Quote Link to comment Share on other sites More sharing options...
aru Posted March 19, 2003 Report Share Posted March 19, 2003 I've just read this: Because john@localhost.john is the host name but at the bash prompt it comes up as john@john@.localhost.john Then everything is alright except your hostname. A host name is in the form "machine name" + "domain name", so your host name should be only something like "localhost.localdomain" or if you wish "localhost.john" and not "john@localhost.john". john is your user name, so your email address as is user@host.domain is john@localhost.john; I guess you are using an email address as your hostname Quote Link to comment Share on other sites More sharing options...
Cannonfodder Posted March 19, 2003 Report Share Posted March 19, 2003 Another way to change your hostname is (I think) Open a terminal and type hostname whatever. I wouldn't make it the same as the domain name unless you are mapped to your machine somehow (Doesn't sound like it). If you have a domain name and no place to host it, talk to anon as he knows a good cheap site :) Quote Link to comment Share on other sites More sharing options...
bigjohn Posted March 20, 2003 Author Report Share Posted March 20, 2003 aru (and any other of you who know what it all means) This is my /etc/bashrc file # /etc/bashrc # System wide functions and aliases # Environment stuff goes in /etc/profile # by default, we want this to get set. # Even for non-interactive, non-login shells. if [ `id -gn` = `id -un` -a `id -u` -gt 99 ]; then umask 002 else umask 022 fi # are we an interactive shell? if [ "$PS1" ]; then case $TERM in xterm*) PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"' ;; *) ;; esac [ "$PS1" = "s-v$ " ] && PS1="[u@h W]$ " if [ -z "$loginsh" ]; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -x $i ]; then . $i fi done fi fi unset loginsh and this is my /home/john/.bashrc # .bashrc # User specific aliases and functions # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi and as to using an e-mail address as my hostname, no it's just what seems to have come up when I last re-installed (though I don't recall why I re-installed about a month ago)! also, when I typed in export PS1="u@h W $ " I got nothing, just returned me to a $ prompt. regards John :?: Quote Link to comment Share on other sites More sharing options...
aru Posted March 20, 2003 Report Share Posted March 20, 2003 both files seem OK. OK, what do you get after following paul's advices in 2nd and 3th post in this thread; ie, post what do you get while executing the following commands in konsole (copy and paste here the whole output, even the prompt): hostname cat /etc/sysconfig/network echo $PS1 whoami Quote Link to comment Share on other sites More sharing options...
bigjohn Posted March 22, 2003 Author Report Share Posted March 22, 2003 [john@john@localhost john]$ hostname john@localhost.john [john@john@localhost john]$ cat /etc/sysconfig/network NETWORKING=yes FORWARD_IPV4=false HOSTNAME=john@localhost.john DOMAINNAME=john GATEWAY=192.168.7.1 [john@john@localhost john]$ echo $PS1 [u@h W]$ [john@john@localhost john]$ whoami This is what I got by copying and pasteing into Konsole though what it means :?: regards John Quote Link to comment Share on other sites More sharing options...
aru Posted March 22, 2003 Report Share Posted March 22, 2003 [[john@john@localhost john]$ cat /etc/sysconfig/network NETWORKING=yes FORWARD_IPV4=false HOSTNAME=john@localhost.john DOMAINNAME=john GATEWAY=192.168.7.1 OK, the problem is with the HOSTNAME variable. It should be "localhost.john" instead of "john@localhost john" As root, run the following two commands (copy and paste only the text in blue); you won't even need to use a text editor: ~# sed "s/(HOSTNAME=).*/1localhost.john/" /etc/sysconfig/network > /tmp/network && cat /tmp/network > /etc/sysconfig/network ~# service network restart then logout and login back HTH Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.