etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

First setup

Wed Jun 21, 2017 7:24 pm

Hi,

I am trying to run my raspberry pi through my macbook pro retina via ethernet (with a USB ethernet adapter) and have managed to turn on internet sharing and appear to establish a connection but then I don't know where to go from there. How do I login? I researched and found many places say go to terminal and type in ssh pi@ IP address but I just get "connection refused". HELP!

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Wed Jun 21, 2017 8:37 pm

Welcome to the forums.

The sshd server (or Daemon or listener) on an RPi running Raspbian is disabled by default.

Have you taken any steps to enable it?

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 6:15 am

I found sources suggesting I create a blank text file (using texteditor) named "SSH" to copy onto the microSD, removing the extension. I then reinserted the microSD and tried running the terminal command shown but it kept repeating that it wanted a password. I typed in my laptop password and the default pi password and neither worked.

Last login: Thu Jun 22 07:10:39 on ttys000
Elliots-MacBook-Pro-2:~ elliottam$ ssh 169.254.253.226 -l pi
The authenticity of host '169.254.253.226 (169.254.253.226)' can't be established.
ECDSA key fingerprint is SHA256:bcAKVPF3S4E/3FW4UdapllSBOXlnXO79daVoT/WbQ6k.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '169.254.253.226' (ECDSA) to the list of known hosts.
Password:
Password:
Password:

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 6:26 am

If 169.254.253.226 is the local IP address of your RPi (how did you determine this?) then you have now made a connection to the RPi.

The password required is the current (not necessarily the default) password for the remote user specified in the connection request. For Raspbian the default is raspberry, just as it would be if accessing the RPi via a direct keyboard interface.

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 8:29 am

That's the IP address that comes up when I go onto the network tab of system preferences. As you can see I tried typing in a password (raspberry) but it didn't work. Is there any other possible password it would be? Or is there something else I need to be doing?

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: First setup

Thu Jun 22, 2017 8:50 am

You are using a mac, something I know very little about.
But I do have this suspicion that you might be trying to setup an ssh connection to your Mac.
For a connection to work you need two IP addresses, one IP address on the source and another on the target.
You have found one IP address: 169.254.253.226, it is not clear if this is on the Pi or on the Mac.
This is a very special address (169.254.x.x) which is generated by the host if it can not obtain an address in any other way.
It is very likely that each interface has selected an address in that range, you will have to identify the address that has been configured on the Pi interface.
With my little knowledge of Mac I would say that you should be able to find the address with bonjour, maybe a ping using the name "raspberrypi.local" will show you the address to be used with ssh.
The road to insanity is paved with static ip addresses

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 9:01 am

That's the IP address that comes up when I go onto the network tab of system preferences.
As @Ernst has said, that sounds as though you have asked your Mac to report what its own address is, and then made a 'loopback' connection to itself.

That isn't what you want to accomplish, and since there is probably no 'pi' user on your Mac there can be no corresponding correct password.

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 9:38 am

The IP address I quoted is stated for the ethernet connection.

This is what comes up when I try to ping:

Elliots-MacBook-Pro-2:~ elliottam$ ping raspberrypi.local
ping: cannot resolve raspberrypi.local: Unknown host

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: First setup

Thu Jun 22, 2017 9:57 am

Disclaimer: I do not know much about Mac!

1) Is the red LED on the Pi on ?
2) Is the green LED on the Pi on ? Did you notice any activity on this LED ?
3) Are the LEDs on the Pi ethernet interface on ?
4) Have you tried another ethernet cable ?
5) What is the output of "ifconfig" on your Mac ?
6) What power supply are you using to power the Pi ?

Note: I am assuming that you are using a Pi with an onboard ethernet interface.
The road to insanity is paved with static ip addresses

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 10:03 am

1) Red light is on
2) Green light is flashing
3) Yellow light for ethernet
4) No
5) Elliots-MacBook-Pro-2:~ elliottam$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether f4:5c:89:97:ad:83
inet6 fe80::cbc:4ea8:dc9c:6d8e%en0 prefixlen 64 secured scopeid 0x4
inet 192.168.20.29 netmask 0xffffff00 broadcast 192.168.20.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 4a:00:04:db:df:a0
media: autoselect <full-duplex>
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 4a:00:04:db:df:a1
media: autoselect <full-duplex>
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 4a:00:04:db:df:a0
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 06:5c:89:97:ad:83
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 1a:e3:75:6a:81:5d
inet6 fe80::18e3:75ff:fe6a:815d%awdl0 prefixlen 64 scopeid 0x9
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::ee26:8181:97d4:83a5%utun0 prefixlen 64 scopeid 0xa
nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe80::142:a8ab:7f34:6c40%utun1 prefixlen 64 scopeid 0xb
inet6 fd36:cb92:6ec7:ed37:142:a8ab:7f34:6c40 prefixlen 64
nd6 options=201<PERFORMNUD,DAD>
en5: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=4<VLAN_MTU>
ether 00:0e:c6:cf:9f:68
inet6 fe80::c55:d12f:7f69:aa69%en5 prefixlen 64 secured scopeid 0xd
inet 169.254.198.240 netmask 0xffff0000 broadcast 169.254.255.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (100baseTX <full-duplex,flow-control>)
status: active
bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether f6:5c:89:79:59:64
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::f45c:89ff:fe79:5964%bridge100 prefixlen 64 scopeid 0xe
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en5 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 13 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
6) Not too sure but it's pi-branded

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 10:05 am

etam wrote:The IP address I quoted is stated for the ethernet connection.

This is what comes up when I try to ping:

Elliots-MacBook-Pro-2:~ elliottam$ ping raspberrypi.local
ping: cannot resolve raspberrypi.local: Unknown host
Disclaimer: I am not a Mac user - I am simply stating basic principles applicable to any OS.

The IP address you have discovered is almost certainly the address assigned to the Ethernet interface of your own Mac.

Maybe the internet sharing utility you have used has some sort of status or property page that would tell you what address has been assigned to the device (your RPi) at the other end of the Ethernet cable?

This is all assuming that you have no directly-attached display on the RPi and that you wish to operate it entirely 'headless' - that is perfectly possible, but as a new user it is less confusing if at the outset you can access the RPi directly.

You need to know whether the RPi is connected to the network cable and what address has been assigned to it by the connection sharing software on the Mac. There are a number of tools that might assist with that such as arp, nmap and Fing.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 10:11 am

Note: I am assuming that you are using a Pi with an onboard ethernet interface.
Not too sure but it's pi-branded
So you are using a model of RPi without its own Ethernet interface?

Can you say anything further about this pi-branded Ethernet adapter? Do you have a link to the vendor website? Is it usb-connected to your RPi or to your Mac?

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 10:16 am

What do you mean when talking about ethernet interface?

Official Black Raspberry Pi 5.1V 2.5A Power Supply (UK, EU)

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: First setup

Thu Jun 22, 2017 10:21 am

Going through the ifconfig output I can only see horror !!! But that can be because I do not know Mac.
The first thing you must learn is to use code tags !!!!

I have a number of questions that need to be answered by either you or somebody else:

Is this your onboard ethernet interface on the Mac ?

Code: Select all

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether f4:5c:89:97:ad:83 
inet6 fe80::cbc:4ea8:dc9c:6d8e%en0 prefixlen 64 secured scopeid 0x4 
inet 192.168.20.29 netmask 0xffffff00 broadcast 192.168.20.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
Which interface is the USB interface you use to connect to the Pi ?
Is this en1 or en2 ?
Now have a good look at the information below:

Code: Select all

en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 4a:00:04:db:df:a0 
media: autoselect <full-duplex>
status: inactive

en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 4a:00:04:db:df:a1 
media: autoselect <full-duplex>
status: inactive

bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 4a:00:04:db:df:a0 
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
Do you notice that en1 and en2 are inactive and member of the bridge0 which is also inactive ?

Next, what is en5 ?

Code: Select all

en5: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=4<VLAN_MTU>
ether 00:0e:c6:cf:9f:68 
inet6 fe80::c55:d12f:7f69:aa69%en5 prefixlen 64 secured scopeid 0xd 
inet 169.254.198.240 netmask 0xffff0000 broadcast 169.254.255.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (100baseTX <full-duplex,flow-control>)
status: active
which is the only member of bridge100

Code: Select all

bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether f6:5c:89:79:59:64 
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::f45c:89ff:fe79:5964%bridge100 prefixlen 64 scopeid 0xe 
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en5 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 13 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
what a mess.
The road to insanity is paved with static ip addresses

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 10:27 am

I bought the pi to learn about coding, I know nothing.

The output I showed you is merely the output from terminal after typing in the command.

All I have done is connected an ethernet cable to the pi and then to a USB ethernet adapter to the laptop.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 10:29 am

Maybe the bridge is a result of enabling internet connection sharing? (Just a guess, not a Mac user.. )

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 10:33 am

I have enabled internet sharing, yes.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 10:34 am

All I have done is connected an ethernet cable to the pi and then to a USB ethernet adapter to the laptop.
I understood you to say that the adaptor is pi-branded? Maybe it is not compatible with the Mac? (My understanding is that Apple are quite 'closed' in their attitude to external third-party hardware.)

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: First setup

Thu Jun 22, 2017 10:41 am

Please remove internet sharing and then do the following exercises:
1) Remove USB ethernet interface from your Mac and do an "ifconfig"
2) Plug the USB ethernet interface, without ethernet cable, into the Mac and do an "ifconfig".
Now compare the output of both commands and identify the interface
3) Plug the ethernet cable into the USB ethernet interface and the Pi, do an "ifconfig"
Look at what the differences are on the interface identified in 2)
Try "ping raspberrypi.local". (I do not know if this is supposed to work on Mac)
The road to insanity is paved with static ip addresses

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 10:44 am

The ethernet adapter isn't pi-branded, the power supply is.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 10:54 am

etam wrote:The ethernet adapter isn't pi-branded, the power supply is.
My mis-interpretation: I got lost in the cross-referenced Q&A!

The question remains: is the external network adapter compatible with your Mac and is it correctly installed? Is it possible to test it by using it for your main internet connection?

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 10:58 am

Well when I connect it to the mac the status of the connection says "connected".

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: First setup

Thu Jun 22, 2017 11:05 am

I guess you are attempting this 'the hard way' because there is some reason why you cannot connect the RPi ethernet cable directly to the same network device as your Mac?

An RPi running Raspbian 'just works' when connected to a working Network outlet on a network that assigns valid IP addresses from its own dhcp server. That's how I work the majority of the time. Other than the requirement to enable the ssh server (a recent security feature added by the Raspberry Pi Foundation) there is no configuration needed on either the RPi or the network.

For that reason I conclude that your issues are related to the configuration of your Mac, and at risk of being thought guilty of buck-passing or finger-pointing I wonder if you would be better off asking about ICS configuration in a Mac-focussed forum?

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: First setup

Thu Jun 22, 2017 11:12 am

etam wrote:Well when I connect it to the mac the status of the connection says "connected".
A few hints:
- you must learn to use code tags
- you must learn to quote
- you must learn to give relevant information

You must try to move into our position and ask your self if the information you are giving will be enough for us to help you.
At the moment I do not have a clue what you are writing about.
The road to insanity is paved with static ip addresses

etam
Posts: 23
Joined: Wed Jun 21, 2017 7:19 pm

Re: First setup

Thu Jun 22, 2017 11:19 am

I guess you are attempting this 'the hard way' because there is some reason why you cannot connect the RPi ethernet cable directly to the same network device as your Mac?
I'm trying to run my pi through my laptop via ethernet so I don't have to use a monitor and buy a keyboard and mouse.

After doing some research it appears I have to do this through SSH but have to enable it on the pi somehow??

Return to “Troubleshooting”