Simon The Pi Man bookstore
Mmmm Raspberry Pi
Simon the Pi Man
To Infinity (probably) and beyond
(A beginners Resource for the Raspberry Pi computer using the Debian distro)
since June 2012

If you are looking for info on the Raspberry Pi computer stay on this site
however
If you are looking for a good cafe in Rye in East Sussex try "Simon the Pie man" near the church.

How2 rename my Raspberry Pi

One of a set of simple easy to use guides for beginners to set up a Raspberry Pi computer.


Ok this instruction sheet will allow you to rename a Raspberry Pi computer from the default name raspberry to in my case rpi1. This is probably the simplest guide so far.

1. Firstly I need remote access to my pi so firstly carry out the How2SetUp Remote Access from the menu on the left.

Lets connect to the Pi remotely using putty so we get the following screen.

Login using the default user pi and the default password raspberry.

2. I shall be changing the name to rpi1 so we need to edit the /etc/hostname file.
pi@raspberrypi:~$ sudo vi /etc/hostname which should look like the entry below

------------------------------------------------------
raspberry
------------------------------------------------------

and change it to

------------------------------------------------------
rpi1
------------------------------------------------------


3. Now we need to check we have edited the file correctly so
pi@raspberrypi:~$ cat /etc/hostname and check that this is what you expected to see.

4. Now we need to edit the /etc/hosts file.
pi@raspberrypi:~$ sudo vi /etc/hosts which should look like the entry below

------------------------------------------------------
::1 raspberry localhost6.localdomain6 localhost6
127.0.1.1 raspberry


127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
------------------------------------------------------

And change the details as below

------------------------------------------------------
::1 rpi1 localhost6.localdomain6 localhost6
127.0.1.1 rpi1


127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
------------------------------------------------------


5. Now we need to check we have edited the file correctly so
pi@raspberrypi:~$ cat /etc/hosts and check that this is what you expected to see.

6. OK all complete so we need to reboot the pi.
pi@raspberrypi:~$ sudo reboot
7. Once the Raspberry Pi has booted up and when you have logged back in, your prompt will have changed to pi@rpi1:
~$ a further check is to run the command pi@raspberrypi:~$ hostname which should show

------------------------------------------------------
rpi1
------------------------------------------------------

This is the name your Raspberry Pi believes it is, and if you are doing Windows File Sharing, the server name to connect your drive maps to.

© simonthepiman.com 2012->2024
email:
simon@villagenet.co.uk

hosted by VillageNetThe Raspberry Pi Foundation is a UK registered charity which exists to promote the study of computer science and related topics, especially at school level, and to put the fun back into learning computing.

Please Note:- any mention of the Raspberry Pi computer on these pages refers to the Raspberry Pi Foundation's product, who also have trademark rights to the term 'Raspberry Pi'.