|
|
Simon the Pi Man
To Infinity (probably) and beyond
(A beginners Resource for the Raspberry Pi computer using the Debian distro)
|
|
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.
|
|
|
How2SetUp remote access to a Raspberry Pi Computer
One of a set of simple easy to use guides for beginners to set up a Raspberry Pi computer.
The first problem i have is that the only TV in the house with an hdmi interface is in
my front room and my nearest network port is in my study and i dont have any long ethernet
cables.
So i need to enable remote access on my Raspberry Pi
Now to get started just plug the hdmi or RCA cable into the pi, and plug it into the telly
then plug in the sdcard with the Operating system(See How2Setup sdcard) into the pi card slot finally plug in the
Raspberry Pi power lead, the pi should boot up to a login prompt Then
enter the default username which is pi and the default password which is raspberry
you should now see some system messages and a prompt
pi@raspberrypi:~$ - this shows that you are logged in as user pi on the machine called raspberry
The first thing i want to do is fix my I.P. address you dont have to but it makes life easier
to connect to a known IP address
We need to fix the I.P address by editing the /etc/network/interfaces file
using either the vi or pico editor(I will for this article assume you know either vi or pico)
- so at the prompt edit the file using vi or pico - i am oldskool so I use vi
~$ sudo vi /etc/network/interfaces
The default interfaces file content will be shown on your screen
----------------------------------------------------------------
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback
iface eth0 inet dhcp
----------------------------------------------------------------
We need to change the eth0(the first and only ethernet port on the pi) detail so
we comment out the current eth0 line by adding a # to the front of the line and add further
lines to define a fixed IP address.
In my case my network is run on 192.168.1.1 from a BT internet box (see How2Setup Find my I.P. details)
therefore I want to fix the address to 192.168.1.200 so i add the lines below.
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
and now save the file.
Lets just check the entries have been saved correctly so type
~$ sudo cat /etc/network/interfaces
and the file contents will be displayed on the TV check the above lines are shown.
Next we want the Raspberry Pi when attached to the network to find a DNS server therefore
we edit the /etc/resolv.conf file and add the google DNS nameservers so that internet
names will work. You may want to use your default gateway I.P so that the requests go
to your ISP instead of google but that is your choice.
~$ sudo vi /etc/resolv.conf
-----------------------------------------------------
nameserver 208.67.220.220
nameserver 208.67.222.222
nameserver 10.10.10.10
-----------------------------------------------------
however i will add the google ones as they are usually fast so the top 2 entries are new
-----------------------------------------------------
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 208.67.220.220
nameserver 208.67.222.222
nameserver 10.10.10.10
-----------------------------------------------------
and now save the file.
just to check the entries have saved correctly type
~$ sudo cat /etc/resolv.conf
and the file contents will be displayed on the TV
OK lets restart the network so that the changes are applied
~$ sudo service networking restart
Now i need the ssh(Secure Shell) service to start at boot, otherwise it wont start and
I will be unable to login remotely
~$ sudo mv /boot/boot_enable_ssh.rc /boot/boot.rc
Now I will shutdown the Raspberry Pi attached to my TV so i can move it to the study and
plug in the LAN cable - so type
~$ sudo shutdown -h now
When System stopped appears - unplug and move to the nearest LAN port and plug back in
the Raspberry Pi will automatically start.
To access this pi from a PC now see How2SetUp access a Raspberry Pi Computer from a PC using putty
|
|
© simonthepiman.com 2012->2024
email: simon@villagenet.co.uk
|
| | The
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'.
|
|