You are not logged in.

#1 2014-05-19 13:54:10

csanyipal
Member
Registered: 2013-10-31
Posts: 32

SSH into headless server

Hi,

I'm trying to rescue my headless power pc box at home.

On my desktop machine I'm running ArchLinux and on my headless server the Debian GNU/Linux Wheezy operating system.

The headless server can be booted with an USB stick rescue system.

I have setup my desktop machine to be a DHCPD server. I did followings:

# nano /etc/dhcpd.conf
# Using the google's dns in the example.
# Change it to 192.168.1.1 if you have a dns server installed
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.20 192.168.1.020;
}

I created the following file too:

# nano /etc/conf.d/dhcp
DHCP_ARGS="-q -s 192.168.1.1"

Then I run the following commands:

# netctl stop ethernet-dhcp
# ip link set up dev enp0s20
# ip addr add 192.168.1.1/24 dev enp0s20
# systemctl start dhcpd4.service

and finally I want to connect to my headless server with SSH:

# ssh root@192.168.1.20

but get the message:

ssh: connect to host 192.168.1.20 port 22: No route to host

What did I wrong?

Regards, from Paul

Last edited by csanyipal (2014-05-19 13:54:33)

Offline

#2 2014-05-19 14:05:33

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,418

Re: SSH into headless server

 
range 192.168.1.20 192.168.1.020;

I'm also not using a /etc/conf.d/dhcp (maybe this required on debian).
Everything should be in /etc/dhcpd.conf that you need.
And you can make a persistent netctl profile so that you don't have to manually make the static ip everytime you reboot.
But if you are making debian your headless server, makes me wonder why it isn't serving dhcpd.

ssh: connect to host 192.168.1.20 port 22: No route to host

This means that the client didn't bind an IP address.  Are you sure the rescue disk is running sshd?

Last edited by nomorewindows (2014-05-19 14:15:48)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2014-05-19 14:21:55

csanyipal
Member
Registered: 2013-10-31
Posts: 32

Re: SSH into headless server

nomorewindows wrote:
 
range 192.168.1.20 192.168.1.020;

I'm also not using a /etc/conf.d/dhcp (maybe this required on debian).
Everything should be in /etc/dhcpd.conf that you need.
And you can make a persistent netctl profile so that you don't have to manually make the static ip everytime you reboot.
But if you are making debian your headless server, makes me wonder why it isn't serving dhcpd.

Sorry, I was unclear. I'm trying to connect from my desktop machine to my headless server, without success.
For this I must to setup my desktop machine as a DHCPD server.
I want not to have this as a persistent setup.

I set it to right, now I have:

range 192.168.1.20 192.168.1.20;

and I restart the services:

systemctl restart dhcpd4.service

Still I get the same error message. What am I missing here?

Offline

#4 2014-05-19 14:50:30

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,418

Re: SSH into headless server

You might want to open up your range a little.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2014-05-19 18:16:09

csanyipal
Member
Registered: 2013-10-31
Posts: 32

Re: SSH into headless server

nomorewindows wrote:

You might want to open up your range a little.

I have now range more open:

range 192.168.1.20 192.168.1.50;

I restarted the dhcpd server:

systemctl restart dhcpd4.service

I get still the same error message:
ssh: connect to host 192.168.1.20 port 22: No route to host

One more observation: the /var/lib/dhcp/dhcpd.leases file shows not any leases.
The output of the following command is empty:

less /var/lib/dhcp/dhcpd.leases

However, my desktop machine hasn't an Internet connection so I think that that the line:

option domain-name-servers 8.8.8.8;

has not any effect.

Last edited by csanyipal (2014-05-19 18:24:34)

Offline

#6 2014-05-19 19:12:11

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,418

Re: SSH into headless server

It's just that your rescue system isn't getting an IP address.  Not sure what you've tried before, you may have to hook up a monitor on your headless monster to see what's not working about it.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#7 2014-05-19 19:44:54

cris9288
Member
Registered: 2013-01-07
Posts: 348

Re: SSH into headless server

Is your server running iptables? I noticed the default behaviour on my centos box was to have iptables return "no route to host" if a packet is dropped in order to avoid giving potential attackers knowledge of an existing server.

Offline

#8 2014-05-20 01:46:37

chancho
Member
From: Hong Kong
Registered: 2006-07-14
Posts: 114

Re: SSH into headless server

do you have a router at home. can it be dhcp server ?

Offline

#9 2014-05-21 18:57:54

csanyipal
Member
Registered: 2013-10-31
Posts: 32

Re: SSH into headless server

Thank you all for help!

I can to boot a rescue system on my headless power pc box by following these steps:
http://wiki.excito.org/wiki/index.php/Rescue_System
I have tried some rescue systems but only have success with one.
So, I can now SSH into my headless power pc box, and there I can to edit the file /etc/network/interfaces .

What I don't know yet is that that how to setup my home network.
The headless power pc box should be my gateway/router that get it's static IP address from my ISP, and my desktop pc box is on LAN of that headless power pc box ( gateway/router ). Actually, I don't know how to setup the /etc/network/interfaces file on headless powerpc box to achieve this goal.

Have you any advices for me in this?

Offline

#10 2014-05-23 01:39:09

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,418

Re: SSH into headless server

csanyipal wrote:

What I don't know yet is that that how to setup my home network.
The headless power pc box should be my gateway/router that get it's static IP address from my ISP, and my desktop pc box is on LAN of that headless power pc box ( gateway/router ). Actually, I don't know how to setup the /etc/network/interfaces file on headless powerpc box to achieve this goal.

It can't get it's static IP from the ISP, you manually enter that yourself or you have DHCP from the ISP (which is normally the case).  If you use whatever DHCP addresses come from the ISP (hopefully this is private addresses), then you don't really need Arch or anything else serving DHCP.  You might be getting into DHCP competition.  You only need one DHCP server.  If you're doing something complex like PXE booting, then you'll need a router/arch box capable of configuring various DHCP options.  One if by static IP, two if by DHCP, you shouldn't have to deal with your /etc/network/interfaces.  Then you can just figure out what IP has been assigned to your headless box.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB