简体   繁体   English

在嵌入式Arm机器上设置SSH服务器

[英]Setting up ssh server on an embedded arm machine

I have an Arndale board and an x86 desktop machine, both running Linux (Ubuntu on ARM and Debian on desktop, I think). 我有一台Arndale板和一台x86台式机,都运行Linux(我认为ARM上的Ubuntu和台式机上的Debian)。 The machines are connected with a straight ethernet cable; 机器用直的以太网电缆连接; it shows up as "eth1" on the desktop and "eth0" on the ARM machine. 它在桌面上显示为“ eth1”,在ARM计算机上显示为“ eth0”。 I want to have the ARM machine run an ssh server, so that most of the development can happen on the desktop machine. 我想让ARM机器运行ssh服务器,以便大多数开发可以在台式机上进行。 How do I configure the network interfaces and ssh to accomplish this? 如何配置网络接口和ssh以完成此操作? I already have openssh services running on both machines. 我已经在两台计算机上运行了openssh服务。

This is what I tried (it's probably silly and wrong): on the desktop machine I added these lines to /etc/network/interfaces 这就是我尝试过的(可能很愚蠢和错误):在台式机上,我将这些行添加到了/etc/network/interfaces

iface eth1 inet static
    address 192.168.168.1
    netmask 255.255.255.0

and then executed ifup eth1 . 然后执行ifup eth1 These are the output of ifconfig : 这些是ifconfig的输出:

eth1      Link encap:Ethernet  HWaddr 00:e0:4c:03:0f:56  
          inet addr:192.168.168.1  Bcast:192.168.168.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe03:f56/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:648 (648.0 B)  TX bytes:468 (468.0 B)

I set the address of eth0 on the ARM machine likewise as "192.168.168.0". 我在ARM机器上将eth0的地址设置为“ 192.168.168.0”。 I then tried to ping the ARM board (192.168.168.0) from the host machine, and nothing happens. 然后,我尝试从主机ping通ARM板(192.168.168.0),但没有任何反应。 I tried to arp the ARM board's MAC address, and it doesn't work either. 我尝试过arp ARM板的MAC地址,但是它也不起作用。 What should I do? 我该怎么办? Have I got something mixed up or mistaken? 我有混淆或错误的东西吗?

Thanks 谢谢

With a 24 bit subnet mask, the .0 and .255 addresses are not usable for actual devices. 使用24位子网掩码时,.0和.255地址不适用于实际设备。 You might try setting your embedded linux to use .2 as its address and see if that fixes your problem. 您可以尝试将嵌入式Linux设置为使用.2作为其地址,看看是否可以解决您的问题。

You can do below way. 您可以按照以下方式进行。

#eth0 down
#ifconfig eth0 192.168.6.14 netmask 255.255.255.0 broadcast 192.168.6.6
#eth0 up

The IP address I have used is for an example you have to use the required IP for your server. 以我使用的IP地址为例,您必须为服务器使用所需的IP。 In My case the Target IP is 192.168.6.14 nemask is 255.255.255.0 and gateway is 192.168.6.6. 在我的情况下,目标IP为192.168.6.14,掩码为255.255.255.0,网关为192.168.6.6。

Then it will start pinging. 然后它将开始ping。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM