Can I Change Computer Name?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Apsey

Can I Change Computer Name?

Post by Apsey »

Hi folks! Linux Mint 11. Careless of me at install to accept default computer name. I've looked and searched for a way to clean it up but can't find where to do it, if it's even possible. TIA
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Anakinholland

Re: Can I Change Computer Name?

Post by Anakinholland »

Hi Apsey,

You need to change 2 files:
  • /etc/hostname - enter the new hostname
    /etc/hosts - replace the hostname after 127.0.0.1
you don't need to reboot, you can run the command

Code: Select all

hostname <<NewName>>
When you next boot, the system will read /etc/hostname and set it accordingly.

source

Regards,

Anakin
Apsey

Re: Can I Change Computer Name?

Post by Apsey »

Thank you Anakin. It sounds so easy but I am new to Linux. This is not a big deal, but being unable to even understand how to follow your simple instructions has sent me on a mission to better understand the whole root user and sudo thing. I won't mark this [Solved] just yet, but will attempt to figure out where to go from here on my own. Thank you again for your willingness to assist.
Anakinholland

Re: Can I Change Computer Name?

Post by Anakinholland »

Apsey wrote:Thank you Anakin. It sounds so easy but I am new to Linux. This is not a big deal, but being unable to even understand how to follow your simple instructions has sent me on a mission to better understand the whole root user and sudo thing. I won't mark this [Solved] just yet, but will attempt to figure out where to go from here on my own. Thank you again for your willingness to assist.
Ah, sorry about that. I've only recently started using Ubuntu-based stuff, so still not in the routine of using sudo...

Yes, you need to edit them as a different user as you've already noticed.

The easiest way to do this, is to start a text-editor as root, using for instance the following command:

Code: Select all

gksu gedit
Next, you can edit the files mentioned :)

Yes, I know I mention yet another item here, gksu, not sudo. Rule-of-thumb: use gksu for graphical processes, sudo for commands in the console.

Anakin
Hyc

Re: Can I Change Computer Name?

Post by Hyc »

I found that the best way to do this is to open a terminal and enter the command,

Code: Select all

su
Type in your administrator password.

cd into the etc directory (2 levels up on my system). Simply vi into the "hostname" and "hosts" file, and change the names just as it says above. Write the file and close it out.

Good to go! Hope this helps.
Anakinholland

Re: Can I Change Computer Name?

Post by Anakinholland »

Cheers for addition Hyc! :)

However, on Ubuntu and any of its offspring, this will not work out-of-the-box, as the password for the user root is unknown to us.

You would have to use

Code: Select all

sudo su
and enter your own password.

Besides that, gedit is by far easier to new Linux-users. :)

Just to be complete (I completely support the use of vi!):

http://www.washington.edu/computing/unix/vi.html
http://www.lagmonster.org/docs/vi.html
http://www.laeff.cab.inta-csic.es/Laeff ... sheets.pdf
Locked

Return to “Beginner Questions”