[CentOS] Cannot open port 631 for Cups printer sharing

JohnS jses27 at gmail.com
Mon Mar 2 21:41:52 UTC 2009


On Mon, 2009-03-02 at 16:00 -0500, b.j. mcclure wrote:
> On Mon, 2009-03-02 at 15:31 -0500, JohnS wrote:
> > On Mon, 2009-03-02 at 15:13 -0500, b.j. mcclure wrote:
> > > On Mon, 2009-03-02 at 11:14 -0800, Scott Silva wrote:
> > > > on 3-2-2009 8:20 AM b.j. mcclure spake the following:
> > > > > I have been trying to set up printer sharing on the LAN.All machines are
> > > > > CentOS 5.2 fully updated. The problem server is a fresh build.  The box
> > > > > it is replacing worked fine for many months.
> > > > > The problem appears to be a closed port 631 on the new box.  iptables
> > > > > and ip6tables are stopped as shown by the output below.  To confirm I
> > > > > was using nmap correctly I ran it against the old server first which
> > > > > shows 631 open.  No matter what I do to the new box (192.168.2.205) 631
> > > > > remains closed.  I was running it on the new box via ssh which I think
> > > > > eleminates any swithc/router issues.
> > > > > 
> > > > > Any thoughts gladly accepted.  This must be something simple/stupid I
> > > > > have overlooked.  Not much hair left to pull out. ;-/
> > > > > 
> > > > 
> > > > 
> > > > Cups defaults to only being open on localhost. You have to edit the config
> > > > file to open more up.
> > > 
> > > Perhaps I misunderstand your suggestion but cupsd.conf is identical for
> > > the machine that works properly and the one upon which I cannot get port
> > > 631 open, even on localhost.
> > > 
> > Try this: netstat -n -l -p | grep 631 Maybe a another process has it but
> > I think you did say it did not come up with nmap? Last option I know to
> > check would be to see if it has a socket file in /var/run/cups. It needs
> > that before it will listen on port 631.
> 
> Thanks for the suggestions.
> 
> [root at webserver ~]# netstat -n -l -p | grep 631
> tcp        0      0 ::1:631                     :::*
> LISTEN      6941/cupsd          
> udp        0      0 0.0.0.0:631                 0.0.0.0:*
> 6941/cupsd

That's hard to understand because its there.

> Looks like cups has it and cups.sock does exist in /var/run/cups.
> 
> [root at webserver ~]# ls /var/run/cups
> certs  cups.sock
> 
> > I've herd many people say the config is the same as the machine but why
> > not just take it and try it on the one that want work, then service cups
> > restart. Remember something there are no two machines ever alike!
> 
> Of course you are right about no two machines being identical.  I did as
> requested and copied the working config file to the non working box with
> no change.  Port 631 still closed.  I also ran nmap against the
> apparently closed port with the -P0 option and it shows "closed" as
> distinguished from filtered.

Shut down SE Linux. or put it in Permissive mode. Netstat shows it is
there but something is a killing it. There seems to be Hundreds of posts
pertaining to your problem. Going back all the way to 2003. Also there
is reports in redhat bugzilla some solved and some not.

JohnStanley




More information about the CentOS mailing list