LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-12-2020, 06:35 PM   #1
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
Can not connect to port 631 on Pi 3 from any system on home lan


The title says it all. Some background.

The Pi3 is running current. I updated the May 1st updates on the 2nd, I did not boot the system until today. Today I installed the latest kernel, modules, firmware and hacks from Sarpi. After the install I booted the Pi.

I have had it installed for about 1 year, so lots of updates over that time. Printing had worked well over that year. The Pi runs headless, and I also run a NFS share from a USB attached 120 gig hard drive on the Pi.

I can ssh into the Pi, I can see the NFS shares on the pi, however, no longer can I send a print job to the USB attached HP printer.

A scan with zenmap shows port 631 closed. Just for giggles, I used nc to confirm port 631 is closed.

From the zenmap scan:

Code:
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-12 19:23 EDT
Nmap scan report for RaspPi (192.168.1.69)
Host is up (0.0020s latency).
Not shown: 95 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
2049/tcp open  nfs
MAC Address: B8:27:EB:5F:36:05 (Raspberry Pi Foundation)

Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
Lpstat shows:

Code:
lpstat -p
printer HP_LaserJet_M203-M206 is idle.  enabled since Tue 24 Dec 2019 01:29:00 PM EST
I followed this link:
Code:
https://wiki.alienbase.nl/doku.php?id=slackware%3acups
to set up /etc/cups/cupsd.conf. Here is the parts I changed, thinking this would fix the problem.

Quote:
LogLevel warn
PageLogFormat

# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# Restrict access to the server...
<Location />
Order deny,allow
Deny From All
Allow From 127.0.0.1
Allow From 192.168.1.*
</Location>

# Restrict access to the admin pages...
<Location /admin>
Order deny,allow
Deny From All
Allow From 127.0.0.1
</Location>
I have not changed anything else in the file. 631 remains closed after restarting cups, or a cold boot. I do not have a firewall running. I have never had one on the home lan. I do have a firewall in my router.

I would like to send a print job to the printer locally, just to verify the print driver ( hplip ) is good, it was before any of the updating.

Thoughts on what I'm missing?

I have thought I could remove the latest kernel, and put the system back to the previous kernel. I would much rather fix what is wrong with the latest updates.

The latest kernel I installed from Sarpi:

Quote:
uname -a
Linux RaspPi.cliffshome.org 5.4.38-v7-arm #1 SMP Sat May 9 22:34:17 BST 2020 armv7l BCM2835 GNU/Linux
 
Old 05-12-2020, 07:15 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,776

Rep: Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933
Quote:
# Only listen for connections from the local machine.
Listen localhost:631
cups is only listening to localhost so the output of nmap is as expected versus

nmap localhost -p 631

Is the printer supposed to be shared via cups? If so then it would be
# Allow remote access
Port 631

Last edited by michaelk; 05-12-2020 at 07:16 PM.
 
Old 05-12-2020, 07:15 PM   #3
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by camorri View Post
Thoughts on what I'm missing?

I have thought I could remove the latest kernel, and put the system back to the previous kernel. I would much rather fix what is wrong with the latest updates.

The latest kernel I installed from Sarpi:
Not sure what could be causing this issue with your HP printer or port 631. My advice would be to revert back to the previous kernel and modules that worked, for now.

I'm building a new batch as we speak using kernel 5.4.40 and modules. It's currently 01:10am here and I'm hitting the sack. I'll upload the new files after testing. So give it 8-10 hours from now. Then we'll take it from there.
 
Old 05-13-2020, 05:54 AM   #4
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by camorri View Post
The latest kernel I installed from Sarpi:
A new SARPi installer and packages using kernel 5.4.40 is now available for Slackware ARM current. Download them from here:

https://sarpi.fatdog.eu/index.php?p=downloads

I've tested these new packages and as far as I can tell everything is working as expected. If you are still having problems with port 631 after installing them please let me know.

Quote:
Originally Posted by michaelk View Post
cups is only listening to localhost so the output of nmap is as expected versus

nmap localhost -p 631

Is the printer supposed to be shared via cups? If so then it would be
# Allow remote access
Port 631
Thanks Michael,
Code:
root@jook:/# nmap localhost -p 631
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-13 11:47 BST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00023s latency).

PORT    STATE  SERVICE
631/tcp closed ipp

Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds
root@jook:/#
That's the output of your command on my RPi3. As expected it's not open but very much detected.
 
Old 05-13-2020, 12:30 PM   #5
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Original Poster
Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
I filally have fixed the problem. This line, in /etc/cups/cupsd.conf was prevening port 631 from opening on my local lan.

Quote:
# Only listen for connections from localhost.
Listen localhost:631
I have changed it to
Quote:
# Only listen for connections from the local network.
Port 631
Port 631 opens to the network, and I can print to the HP printer on the Pi.

Nmap now shows:

Quote:
# nmap -T4 RaspPi
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-13 13:24 EDT
Nmap scan report for RaspPi (192.168.1.69)
Host is up (0.000035s latency).
rDNS record for 192.168.1.69: RaspPi.cliffshome.org
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
2049/tcp open nfs
Exaga, thank-you for your effort on the Sarpi project. I did go back to the older kernel, that did not fix the problem. I don't believe the four packages; kernel, kernel modules, firmware, or hacks has anything to do with the error.

I think the problem ( lack of correct configuration ) was introduced when I upgraded the cups package, I did not boot the system at that time. It was not until I had updated the kernel packages that I booted the Pi. Lesson learned.
 
1 members found this post helpful.
Old 05-13-2020, 01:01 PM   #6
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by camorri View Post
I filally have fixed the problem. This line, in /etc/cups/cupsd.conf was prevening port 631 from opening on my local lan.

Exaga, thank-you for your effort on the Sarpi project. I did go back to the older kernel, that did not fix the problem. I don't believe the four packages; kernel, kernel modules, firmware, or hacks has anything to do with the error.

I think the problem ( lack of correct configuration ) was introduced when I upgraded the cups package, I did not boot the system at that time. It was not until I had updated the kernel packages that I booted the Pi. Lesson learned.
Excellent work. Nice one.

I realised as soon as I ran Michael's command and my port 631 showed up that it must have been a config issue that caused your error. Now you know better for next time.

You're more than welcome to SARPi. It's great that users are able to install Slackware ARM and use/run it on the Raspberry Pis. The devices are very user-friendly and come with much built-in easiness by default, plus the additional benefits of being very popular platform and well supported in the RPi Linux source and boot-firmware. Slackware ARM runs like a dream on these things, that's for sure.

Well done to you, camorri!
 
  


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
Closing port 631 (IPP) jrdioko Linux - Security 3 03-21-2007 02:39 AM
Could not connect to host localhost (port 631) fireedo Slackware 6 01-05-2007 11:55 AM
closing cupsd port 631 drove me crazy, now closed, mdv 2007 Emmanuel_uk Mandriva 1 11-14-2006 04:52 AM
Guarddog leaves Cups port 631 open, how do I close it? tigerflag Linux - Security 4 08-29-2004 12:28 PM
my server on port 631 tekmorph Linux - Security 2 08-28-2004 09:47 PM

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

All times are GMT -5. The time now is 02:02 AM.

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