SSH over ssh

Hi,
I'm trying to talk to a black box via ssh, through the wired Ethernet port, as a client.

While controlling the Yun via ssh (using putty) via wifi...

And so far I'm shooting blanks.

Trying to ssh username@192... etc.. (the black box)
From the command line, then putty just hangs.

I'm assuming it's because the yun is trying to connect via wifi to the black box? Rather than using the ethernet port?

If I'm right in my guess, how can I force, or persuade even, the yun to go, via ssh, to the ethernet port to see my black box, while running wifi?

I think you should ask the moderator to move this to the Yun section of the Forum. Click Report to Mod in this post.

...R

Thanks Robin. I'll do as you suggest.

And I tried it...

But was told reporting my own thread didn't make sense!

I'm happy for any mod to move this thread to somewhere more suitable?

Your Yun, by default, is configured to set IP addresses on its Wifi and ethernet interfaces using DHCP. Your Wifi router assuredly has a DHCP server on it so the IP gets set. Your "black box" (note: telling us the color of the box isn't helpful) either doesn't have a DHCP server or it's trying to serve addresses in the same range as the wireless router's DHCP server. If it's the former then you'll need to configure an IP on the ethernet port manually and then add a route so that the Yun knows to use the ethernet port to make connections to your black box., and if it's the latter then you'll just need to add the route.

Verypp:
And I tried it...

But was told reporting my own thread didn't make sense!

That's why I told you click Report to Mod in my post !!!!!

...R

I should read posts more carefully :blush:

Chagrin:
Your Yun, by default, is configured to set IP addresses on its Wifi and ethernet interfaces using DHCP. Your Wifi router assuredly has a DHCP server on it so the IP gets set. Your "black box" (note: telling us the color of the box isn't helpful) either doesn't have a DHCP server or it's trying to serve addresses in the same range as the wireless router's DHCP server. If it's the former then you'll need to configure an IP on the ethernet port manually and then add a route so that the Yun knows to use the ethernet port to make connections to your black box., and if it's the latter then you'll just need to add the route.

Thanks for your reply and comments,
I use the term 'black box' as it's a fairly well known/used reference, around these parts anyhow, to a part, component or bit of software that little is known about.

The unit I'm trying to communicate with is not something I'm in any way familiar with. I've been given a unit, a few commands to talk to it and a web address to check the 'updates' have taken place.
I know I can issue all these commands from my pc using putty over ssh .
I now need to do it from a yun, or something similar, over a wired ethernet connection?

And I'm very mostly a hardware engineer and I'm a bit out of my comfort zone with this kind of problem....

So, being thick, how do I add a route to the wired ethernet port?
I reckon I can set a static ip address for the yun, and the ip address for my 'box' (actually white) is always the same.

I want to send some basic commands to this box, from the command line, operating as a client to the box, so any suggestions how do I do it?

You'd need to provide complete network details: the IP of the PC, Yun, and "box". "ifconfig -a" and "netstat -rn" output from the Yun would be helpful. And stop defining this mystery "box" by color and state what the device actually is.

Are your yun and your blackbox on the same network? Can you prove it showing us their IP addresses?
Can you ping the black box from the yun?
Can you SSH to the blackbox from your PC ?

Thanks for your reply,

No I don't believe my Yun and the box I'm trying to communicate with are on the same network.
Well at least not my wifi Yun.
The box I'm trying to communicate with, which is some kind of multi media box, also with a wired ethernet hub built in.
I want to set a few variables in the box, (serial number, reg number etc.) with a few commands I've been given.
I can do it from a Pi from the command line, but the pi does not lend itself to building a hand held, battery operated device, with a simple 16 x2 display, especially if, like me , you're a linux newbie... So I'm trying the yun.

If it helps, the box has a fixed (static?) ip address of 192.254.1.250
My yun has a wifi ip of 192.254.0.14
The box, (I assume?), allocates an address of 192.254.1.16 to the yun wired (ethernet) connection when I plug it in.

Now I tried to do what I did on the pi, type 'ssh myboxusername@192.254.1.250'
at the command line.
Then I expect some response asking for a password. But this doesn't happen.
My assumption, maybe wrong , is that my yun is trying to find this box on wifi network?

And to answer your other question, yes I have tried pinging it, but no it doesn't ping.

It may be something very simple here, but, as I say, I'm a real novice on the linux stuff..

And to answer your last question, yes I can connect to my box (via putty) from my pc, and do everything I want from there.

Verypp:
Thanks for your reply,

No I don't believe my Yun and the box I'm trying to communicate with are on the same network.
Well at least not my wifi Yun.
The box I'm trying to communicate with, which is some kind of multi media box, also with a wired ethernet hub built in.
I want set a few variables in the box, (serial number, reg number etc.) with a few commands I've been given.
I can do it from a Pi from the command line, but the pi does not lend itself to building a hand held, battery operated device, with a simple 16 x2 display, especially if, like me , you're a linux newbie... So I'm trying the yun.

If it helps, the box has a fixed (static?) ip address of 192.254.1.250
My yun has a wifi ip of 192.254.0.14
The box, (I assume?), allocates an address of 192.254.1.16 to the yun wired (ethernet) connection when I plug it in.

IP addresses by themselves mean nothing without the network mask associated with them...

Ralf

Ok,
I believe I've got a standard mask of 255.255.255.0 ?
Do I need to change this?
If so, to what?

Chagrin:
You'd need to provide complete network details: the IP of the PC, Yun, and "box". "ifconfig -a" and "netstat -rn" output from the Yun would be helpful. And stop defining this mystery "box" by color and state what the device actually is.

I'm not quite quite sure why/if you're trying to make some kind of issue out of my initial description re colour?
It is a well recognized term..
Black box - Wikipedia.

It's not a mystery box, but it is a box on which I have few details.
It is, as far as I'm aware, a multi-media unit, with an ethernet hub built in.
I know it's ip address, username and password.
I know I have to use ssh to communicate with it, and I have to use a wired Ethernet connection.
And I've been given about 5 commands to talk to it...
And I know I can communicate with it from my pc, or from the command line on a pi.

Other than that I know diddly squat about about the box. What more do I need to know?

And, as I've said in other posts, I'm a linux newbie, so while I'll happily type in "ifconfig -a" or "netstat -rn" into my yun, could you tell me what I'm doing, or trying to do ?

Verypp:
No I don't believe my Yun and the box I'm trying to communicate with are on the same network.
Well at least not my wifi Yun.

PCWorxLA:
IP addresses by themselves mean nothing without the network mask associated with them...

Verypp:
I believe I've got a standard mask of 255.255.255.0 ?

Then I believe it ain't gonna work. For a simple lan setup, two computers have to part of the same network in order to connect to each other. If this is not possible, problem can be solved with medium to complex networking and routing skills.

My advice: try to put your yun on the same network of the media center. It should get an IP like 192.254.1.x. Use the ethernet plug if reconfiguring your home wifi is too complex or just impossible.
Then, from a network point of view, you'll have a green light.

Verypp:
I'm not quite quite sure why/if you're trying to make some kind of issue out of my initial description re colour?
It is a well recognized term..

"Vehicle" is a well-recognized term also. But you don't go to your mechanic with the expectation that he doesn't care what kind of vehicle you have, do you? Do you get obstinate when he asks for more detail and start providing Wikipedia links or try to placate him with a statement like "Well, it's an old truck"?

Verypp:
And, as I've said in other posts, I'm a linux newbie, so while I'll happily type in "ifconfig -a" or "netstat -rn" into my yun, could you tell me what I'm doing, or trying to do ?

The ethernet interface needs to have an IP configured on it manually as, by default, it attempts to get an IP from the device it's attached to using DHCP. "ifconfig -a" shows the current state of the WiFi and ethernet port. "netstat -rn" shows the current network routing. Not only do you need to set an IP on your ethernet port you also need to ensure that connections to the media device will be routed through that ethernet port.

I think your problem can be solved by executing:

ifconfig eth1 192.254.1.251 netmask 255.255.255.254

This command should also automatically add a route for 192.254.1.250/31 for that ethernet port.

Perform a "ping 192.254.1.250" to test to see if the connection works. Using SSH to test an ethernet connection can be unreliable -- notably a lack of DNS availability by the destination host can cause a long lag in the connection time. If the ping works then exercise patience when testing the SSH connection.

If nothing works, then again, provide the netstat and ifconfig output. Also, you may need a crossover ethernet cable between the Yun and media device. If the media device has a "link" light on the ethernet port then pay attention to see if it lights up when the cable is plugged in.

As an aside, 192.254.1.0/24 is a publicly addressable address range. 192.168.0.0/16 is typically used for a private network. You might already be aware of that, but just pointing it out.

Chagrin:

Verypp:
I'm not quite quite sure why/if you're trying to make some kind of issue out of my initial description re colour?
It is a well recognized term..

"Vehicle" is a well-recognized term also. But you don't go to your mechanic with the expectation that he doesn't care what kind of vehicle you have, do you? Do you get obstinate when he asks for more detail and start providing Wikipedia links or try to placate him with a statement like "Well, it's an old truck"?

Verypp:
And, as I've said in other posts, I'm a linux newbie, so while I'll happily type in "ifconfig -a" or "netstat -rn" into my yun, could you tell me what I'm doing, or trying to do ?

The ethernet interface needs to have an IP configured on it manually as, by default, it attempts to get an IP from the device it's attached to using DHCP. "ifconfig -a" shows the current state of the WiFi and ethernet port. "netstat -rn" shows the current network routing. Not only do you need to set an IP on your ethernet port you also need to ensure that connections to the media device will be routed through that ethernet port.

I think your problem can be solved by executing:

ifconfig eth1 192.254.1.251 netmask 255.255.255.254

This command should also automatically add a route for 192.254.1.250/31 for that ethernet port.

Perform a "ping 192.254.1.250" to test to see if the connection works. Using SSH to test an ethernet connection can be unreliable -- notably a lack of DNS availability by the destination host can cause a long lag in the connection time. If the ping works then exercise patience when testing the SSH connection.

If nothing works, then again, provide the netstat and ifconfig output. Also, you may need a crossover ethernet cable between the Yun and media device. If the media device has a "link" light on the ethernet port then pay attention to see if it lights up when the cable is plugged in.

As an aside, 192.254.1.0/24 is a publicly addressable address range. 192.168.0.0/16 is typically used for a private network. You might already be aware of that, but just pointing it out.

Apologies if I was being a bit vague and/or a bit obstinate, it wasn't my intention.
I do appreciate your efforts to help me.

But sadly I would be that bad with my car too, I know even less about that thing than I know about this box. Maybe that's why I keep having to pay so much to keep the thing running... :~

Anyhow I've managed to get this box talking to my yun.
It was just a case of disabling the wifi and bringing everything ( yun, pc and box) onto the same wired network, as was mentioned by yourself and others.

Now it's just a case of getting the arduino side of things doing the same... :slight_smile:

Thanks all for your help and advice.