Announcement

Collapse
No announcement yet.

Can I change the "name" in terminal?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I change the "name" in terminal?

    I didnt think that much of it when i installed kubuntu but I should have changed my computer name to something better.
    As it is now the long odd number/letter combination (mikael@c-d726e353:~&) annoys me big time. So my question is, are there anyway to change the last part (c-d726e353) to something shorter without reinstalling everything.
    Hope someone knows what to do.

    Thanks/
    Leonin


    #2
    Re: Can I change the "name" in terminal?

    type> hostname name_you_want
    Richard Johnson (nixternal)<br />Core Developer :: MOTU :: MOTU Council :: Community Council<br />https://launchpad.net/~nixternal<br />http://www.nixternal.com

    Comment


      #3
      Re: Can I change the &quot;name&quot; in terminal?

      Well I did that but nothing happened. Or atleast nothing that i can see.

      Comment


        #4
        Re: Can I change the &quot;name&quot; in terminal?

        Hmm now it "works", but it broke everything. When I try sudo apt-get i get the following error; sudo: unable to look up wahlin via gethostbyname()   

        wahlin is the name that i changed it too. Any idea on how I can repair it?

        "edited"
        Well I did a quick restart and everything works fine now. Mainly because the hostname got reset to the install version. So i guess I'm back on square one. =) "

        Comment


          #5
          Re: Can I change the &quot;name&quot; in terminal?

          Hmm now it "works", but it broke everything. When I try sudo apt-get i get the following error; sudo: unable to look up wahlin via gethostbyname()
          sudo can start hickuping if you edit hostname 'on the fly'...to avoid this it is a good idea to edit from a root terminal ('sudo -i') so you don't have to rely on sudo.

          try a reboot to fix it, if it doesn't work, check that the hostname matches in /etc/hosts and /etc/hostname.

          you can start in recovery mode if you need to edit them (recovery console logs you in as root)

          Comment


            #6
            Re: Can I change the &quot;name&quot; in terminal?

            sudo -i, i´ve always thought that when I typed sudo "something, something" I was root. You learn something everyday.
            Anyway. How do I change the host name, not on the fly? By editing the hostname in /etc/hosts and /etc/hostname?

            Comment


              #7
              Re: Can I change the &quot;name&quot; in terminal?

              Originally posted by Leonin
              sudo -i, i´ve always thought that when I typed sudo "something, something" I was root. 
              'sudo -i' is just a special use of sudo (very similar to 'sudo su' and 'sudo -s')...with it you can get into a root terminal to perform multiple commands as root so you don't have to use sudo with every command (which comes is handy if a command will break sudo functionality )

              sudo "something, something" runs the commands as root, but root privileges apply for those commands only.

              Anyway. How do I change the host name, not on the fly? By editing the hostname in /etc/hosts and /etc/hostname?
              That's one way to do it

              Comment


                #8
                Re: Can I change the &quot;name&quot; in terminal?

                great now it works. Thanks for all your help .

                Comment

                Working...
                X