LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 03-25-2023, 11:00 PM   #1
particular_dude
LQ Newbie
 
Registered: Feb 2023
Location: In a house, mostly
Distribution: slackware
Posts: 5

Rep: Reputation: 1
Red face Headless install - Sarpi - Pi 2 B - SSH Connection Refused


Trying to run a headless install on my Pi with the latest Sarpi image (monitor, keyboard, mouse to do a regular install isn't an option for the time being), but I can't get it to allow me to establish an ssh connection; all attempts are met with a "Connection refused on port 22" error.

I've checked several times, using all combinations of IP, hostname, root, and no username, but the response is always the same. I verified that the router has granted a dhcp lease to the Pi (reports a hostname of slackware.lan) and has no active firewall rules.

I get ICMP replies without any trouble, tcpdump shows my SYN being met with an immediate RST, and nmap reports no open ports found on the Pi. The physical layer is about as simple as I can get without doing a direct NIC to NIC connection between the client and the host:

Router
WAN port - Not connected to any device
LAN port 1 - client
LAN port 2 - Pi
Address assignment: DHCP

Both devices are assigned addresses on the same /16, no traffic delivery problems seen on client or router.

Given all of this, I suspected that there's something going on with the Pi that's causing sshd to not run, and confirmed multiple times that the required changes are present and there's no additional whitespace or linebreaks in the cmdline.txt configuration (as per the information detailed in the "Notes for Pre-installation" page on the Sarpi project site). I saw the Raspbian folks need an empty file named 'ssh' in the root directory for their headless install procedure; adding this had no effect on the behavior.

I'm pretty much stumped here, I gotta say. The only thing I haven't tried is a NIC to NIC setup, eliminating the router from the equation. I've not done that, though, since there's no indication (that I see, at least) of this being a problem at the network layer. All the symptoms point to there being no ssh server running on the Pi, but I'm not familiar enough with how these images work to gain any direct insight without either a remote session, or peripherals I don't have access to.

Any of y'all got any suggestions on where I could go from here?

Last edited by particular_dude; 03-26-2023 at 12:11 AM.
 
Old 03-26-2023, 05:38 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Have you sshd running and the default /etc/ssh files? Do you need to generate keys? You might do if you did some kind of incomplete inatall

If you plug in a keyboard, & monitor, can you talk the other way?
 
Old 03-26-2023, 08:43 AM   #3
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,539

Rep: Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309
Quote:
Originally Posted by business_kid View Post
Have you sshd running and the default /etc/ssh files? Do you need to generate keys? You might do if you did some kind of incomplete inatall

If you plug in a keyboard, & monitor, can you talk the other way?
The installer uses Dropbear and generates its own key at boot.

I am not familiar with how SARpi is configured to boot the installer, but to configure the installer to bring up networking and SSH you need this in the APPEND line to set the Kernel cmdline values:

Code:
nic=auto:eth0:dhcp
Dropbear will start its SSH server but *only* if the network interface has an IP address.
I've seen it in the past where it took several seconds to obtain an IP via DHCP, so the dhcp client backgrounded the IP solicitation task whilst the OS continued to boot. When the dropbear loader runs, it didn't detect an IP and subsequently did not start the SSH server. The IP was eventually assigned to the interface but it was too late.
If you already have that nic= setting above, it may be that you're running into the situation I just described. If not, you'll need a serial cable or monitor and kb, or hack the installer to make it start dropbear regardless.
 
3 members found this post helpful.
Old 03-26-2023, 04:43 PM   #4
Dunc.
Member
 
Registered: Jul 2012
Location: Cumbria UK
Distribution: Slackware
Posts: 58

Rep: Reputation: 30
I have had problems recently logging onto a freshly installed slackware. It was due to ssh authorisation being set to PAM.
Code:
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the KbdInteractiveAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via KbdInteractiveAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and KbdInteractiveAuthentication to 'no'.
UsePAM no
edit /etc/ssh/sshd_config and change UsePAM to no.

It might be that because connection refused is a result of you connecting and not being authorised.

Dunc.
 
1 members found this post helpful.
Old 03-26-2023, 05:25 PM   #5
particular_dude
LQ Newbie
 
Registered: Feb 2023
Location: In a house, mostly
Distribution: slackware
Posts: 5

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by drmozes View Post
Dropbear will start its SSH server but *only* if the network interface has an IP address.
Excellent point! I hadn't considered that at all. I'll edit the text file and the router's config here in a sec and see if taking DHCP out of the mix has any effect on things. Here's hoping!

Quote:
Originally Posted by Dunc. View Post
I have had problems recently logging onto a freshly installed slackware. It was due to ssh authorisation being set to PAM.
Very good info for me to keep in mind, though I'm not sure I'm encountering that situation quite yet, because it appears as though the port isn't even open at all (per nmap and initial SYN packets being immediately met with a RST). It looks as though the server side isn't even reaching the point where it evaluates the login info, as it's just resetting any connection attempts it receives and the initial TCP handshake fails to even be completed.

I'll get the DHCP middleman cut out of the mix here and report back with the results shortly. Thanks for the suggestions!
 
Old 03-27-2023, 04:26 AM   #6
particular_dude
LQ Newbie
 
Registered: Feb 2023
Location: In a house, mostly
Distribution: slackware
Posts: 5

Original Poster
Rep: Reputation: 1
Alright, so a bit of a (non-)update:

Manually setting the IP in cmdline.txt now results in a total lack of response from the Pi, despite the arp table in the router having a correct entry to associate the IP and the Pi's MAC. The Pi's NIC shows the activity led getting triggered each time a packet is sent it's way, but no response comes from it, whether I attempt to ping it, ssh to it, run a portscan on it, whatever.

I went one further and just cut the router out of the mix altogether, used a straight-through cable to connect the pi directly to my laptop's NIC. I got no ARP reply from the Pi at all, entered an entry for it manually, and got the same results as before.

At that point, I cleared out the partition that was created when the image was flashed to the SD card and unzipped the contents of the "boot" zip file to it. I added the static IP settings as before, this time using the exact same address as the example (I had previously set 235 as the value of the last octet), plugged it back into the router after it wouldn't answer my laptop directly, and at that point it finally worked just fine.

In short, it's working, but I'll be danged if I can tell you why it wasn't before. . . Thanks for trying to take a crack at this, y'all. Sorry I couldn't come back with some closure here, but at least it's working!
 
Old 03-27-2023, 12:32 PM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Get the RazPi to a monitor and keyboard and do the sensible basics. Are you using network manager or init scripts? What's the Distro? Do you need spoonfeeding or do you know what you're doing?
 
Old 03-27-2023, 05:44 PM   #8
particular_dude
LQ Newbie
 
Registered: Feb 2023
Location: In a house, mostly
Distribution: slackware
Posts: 5

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by business_kid View Post
Get the RazPi to a monitor and keyboard and do the sensible basics. Are you using network manager or init scripts? What's the Distro? Do you need spoonfeeding or do you know what you're doing?
I'm pretty sure all those questions were answered over the course of this thread, if not in my initial post. As I had said in the beginning of the thread, peripheral attachment was not an option due to lack of physical devices. The problem wasn't that I needed help figuring out how to do an installation; the problem was that an installation method SARPi supports should have been working, but was not, and I was trying to identify the root cause of the behavior.

Regardless, the point is moot, as my previous post confirmed the issue has been cleared, and the title of the thread updated accordingly. While I appreciate the offer, spoon-feeding does not appear to be necessary.
 
1 members found this post helpful.
Old 03-30-2023, 02:43 PM   #9
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by drmozes View Post
The installer uses Dropbear and generates its own key at boot.

I am not familiar with how SARpi is configured to boot the installer, but to configure the installer to bring up networking and SSH you need this in the APPEND line to set the Kernel cmdline values:

Code:
nic=auto:eth0:dhcp
Dropbear will start its SSH server but *only* if the network interface has an IP address.
Good info Stu. I pretty much covered it on this page (and elsewhere in the installer guide) : https://sarpi.penthux.net/index.php?p=preinstall
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SARPi 2 (current) - Can't ssh in for install- arfon Slackware - ARM 5 04-23-2020 07:56 PM
SARPi website new URL - sarpi.co.uk Exaga Slackware - ARM 4 01-28-2018 06:36 PM
SW 14.1 headless install using pxe & ssh slack_please Slackware - Installation 4 04-28-2015 04:51 PM
[SOLVED] Problem to connect to headless Virtualbox 4.0.6 with rdesktop: Connection refused TobiSGD Linux - Virtualization and Cloud 3 04-29-2011 09:14 AM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration