Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: How to change Computer name

  1. #1
    Join Date
    Feb 2009
    Beans
    10

    How to change Computer name

    Hi, I have just now installed Ubuntu 8.10. When I open the terminal I am getting like this

    user@user-laptop:~$

    I want to change "user-laptop" to another name.. How can I do it..

    Thanks in advance.

  2. #2
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: How to change Computer name

    If you want to change the name of your computer, you need to change both in /etc/hostname & /etc/hosts. Changing one without changing the other (to identical name) will cost sudo not to work anymore.
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

  3. #3
    Join Date
    Feb 2009
    Beans
    10

    Re: How to change Computer name

    Quote Originally Posted by taurus View Post
    If you want to change the name of your computer, you need to change both in /etc/hostname & /etc/hosts. Changing one without changing the other (to identical name) will cost sudo not to work anymore.
    Hi Thanks a lot for your reply.
    I could not change the name in /etc/hostname & /etc/hosts through GUI, because Permission denied..
    If possible could you please tell me how can I change it through terminal using "sudo"...
    Thanks.

  4. #4
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: How to change Computer name

    Code:
    gksudo gedit /etc/hostname /etc/hosts
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

  5. #5
    Join Date
    Feb 2009
    Beans
    10

    Re: How to change Computer name

    Quote Originally Posted by taurus View Post
    Code:
    gksudo gedit /etc/hostname /etc/hosts
    Done... Ubuntu rocks... Cheers!

  6. #6
    Join Date
    Oct 2008
    Location
    New Jersey
    Beans
    515
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to change Computer name

    Quote Originally Posted by taurus View Post
    If you want to change the name of your computer, you need to change both in /etc/hostname & /etc/hosts. Changing one without changing the other (to identical name) will cost sudo not to work anymore.
    cant you also change it with the hostname command?
    OH NOES!!! I HAZ CRASHED SERVER!! WHY ON EARTH WOULD YOU DO THAT?!?! CAUSE ITS FUNNY!!!!
    Running either 7.04, 8.04, 8.10, 9.04, it varies.
    You talkin' to me? - Taxi Driver (1976)

  7. #7
    Join Date
    Sep 2009
    Location
    In a cold, dark place
    Beans
    186
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How to change Computer name

    Quote Originally Posted by rhcm123 View Post
    cant you also change it with the hostname command?
    This is something I would like to know myself; what is the command and does it amend it in both files as per the reply earlier from taurus?

  8. #8
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: How to change Computer name

    What that command doess is opens both files to edit the hostname with gedit.

  9. #9
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    5,508
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to change Computer name

    Quote Originally Posted by rhcm123 View Post
    cant you also change it with the hostname command?
    No. The hostname command changes the host name for that session. When you reboot, the host name will revert back to the old one. It's just for testing, and to delay a reboot.

    If you want a permanent change, you need to edit the files that taurus indicated.
    None but ourselves can free our minds

  10. #10
    Join Date
    Feb 2010
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: How to change Computer name

    Quote Originally Posted by taurus View Post
    Code:
    gksudo gedit /etc/hostname /etc/hosts
    Hello everyone,

    I'm quite new with Linux in general, am experimenting with Ubuntu for the first time. I tried to change the Computer name just like taurus indicated, but I get an error that says:

    could not find the file /home/mycomputername/etc/hosts

    I tried to edit the hosts file via gui and command line, got the same error on both. And I did type it correctly.

    Any idea what could be wrong?

    Appreciate your help in advance, this is a great community, proud to be around.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •