# How do I remotely access http://localhost:631/?

## Kasumi_Ninja

I have designated one computer as (printer) server which doesn't have X running. I try to connect from another machine in the network through 

```
http://192.168.1.111:631/
```

 but I can't connect. I've tried adjusting different options in /etc/cups/cupsd.conf to no avail. Who knows what I need to change in order to remotely connect to the cups server?

```
# cat /etc/cups/cupsd.conf

#

# "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $"

#

#   Sample configuration file for the Common UNIX Printing System (CUPS)

#   scheduler.  See "man cupsd.conf" for a complete description of this

#   file.

#

# Log general information in error_log - change "info" to "debug" for

# troubleshooting...

LogLevel info

# Administrator user group...

SystemGroup lpadmin

# 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

BrowseOrder allow,deny

BrowseAllow @LOCAL

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

DefaultAuthType Basic

# Restrict access to the server...

<Location />

  Order allow,deny

  Allow localhost

</Location>

# Restrict access to the admin pages...

#<Location /admin>

#  Encryption Required

#  Order allow,deny

#  Allow localhost

#</Location>

# Restrict access to configuration files...

<Location /admin/conf>

  AuthType Basic

  Require user @SYSTEM

  Order allow,deny

  Allow localhost

</Location>

# Set the default printer/job policies...

<Policy default>

  # Job-related operations must be done by the owner or an adminstrator...

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  # All administration operations require an adminstrator to authenticate...

  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>

    AuthType Basic

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>

#

# End of "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $".

#
```

----------

## ltboy

Change the line "Listen localhost:631" to "Listen 192.168.1.111:631".

That line right now is limiting access to localhost, meaning the computer running the server, to access with another computer on network it needs to listen on the address that the other computers will be accessing it from.

----------

## Kasumi_Ninja

 *ltboy wrote:*   

> Change the line "Listen localhost:631" to "Listen 192.168.1.111:631".
> 
> That line right now is limiting access to localhost, meaning the computer running the server, to access with another computer on network it needs to listen on the address that the other computers will be accessing it from.

 

Thanks for your help. I adjuster cupsd.conf and restarted cups. However when I try connect 192.168.1.111:631 I get:

```
403 Forbidden
```

----------

## think4urs11

you need to change the 'Allow'-Lines too to fit your network

----------

## djinnZ

 *Aniruddha wrote:*   

> # Restrict access to the admin pages...
> 
> #<Location /admin>
> 
> #  Encryption Required
> ...

 

uncomment and add allow <ip of your pc>

----------

## Kasumi_Ninja

 *Think4UrS11 wrote:*   

> you need to change the 'Allow'-Lines too to fit your network

 

I tied that, but I still can't connect    :Sad: 

```
 # cat /etc/cups/cupsd.conf

#

# "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $"

#

#   Sample configuration file for the Common UNIX Printing System (CUPS)

#   scheduler.  See "man cupsd.conf" for a complete description of this

#   file.

#

# Log general information in error_log - change "info" to "debug" for

# troubleshooting...

LogLevel info

# Administrator user group...

SystemGroup lpadmin

# Only listen for connections from the local machine.

Listen 192.168.1.111:631

Listen /var/run/cups/cups.sock

# Show shared printers on the local network.

Browsing On

BrowseOrder allow,deny

BrowseAllow @LOCAL

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

DefaultAuthType Basic

# Restrict access to the server...

<Location />

  Order allow,deny

  Allow 192.168.1.111

</Location>

# Restrict access to the admin pages...

<Location /admin>

  Encryption Required

  Order allow,deny

  Allow 192.168.1.111

</Location>

# Restrict access to configuration files...

<Location /admin/conf>

  AuthType Basic

  Require user @SYSTEM

  Order allow,deny

  Allow 192.168.1.111

</Location>

# Set the default printer/job policies...

<Policy default>

  # Job-related operations must be done by the owner or an adminstrator...

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  # All administration operations require an adminstrator to authenticate...

  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>

    AuthType Basic

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>

#

# End of "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $".

#
```

----------

## think4urs11

the allow statements need to list the ip addresses you are connecting from.

So if you access the admin interface from 192.168.1.123 this needs to be listed, _not_ the ip the server has.

----------

## ltboy

Don't allow the ip of the computer hosting the server. You need to allow the ip of the computer accessing it.

----------

## Kasumi_Ninja

I have mysteriously solved part of this problem by enabling "allow remote administration" locally in http://localhost:631 I can login and see the frontpage but I still can't go to the "Administration" or other tabs   :Crying or Very sad: . Here's the latest cupsd.conf

```
# cat /etc/cups/cupsd.conf

LogLevel info

SystemGroup lpadmin

# Allow remote access

Port 631

Listen /var/run/cups/cups.sock

# Enable printer sharing and shared printers.

Browsing On

BrowseOrder allow,deny

BrowseAllow @LOCAL

BrowseAddress @LOCAL

DefaultAuthType Basic

<Location />

  # Allow shared printing and remote administration...

  Order allow,deny

  Allow @LOCAL

</Location>

<Location /admin>

  Encryption Required

  # Allow remote administration...

  Order allow,deny

  Allow @LOCAL

</Location>

<Location /admin/conf>

  AuthType Basic

  Require user @SYSTEM

  # Allow remote access to the configuration files...

  Order allow,deny

  Allow @LOCAL

</Location>

<Policy default>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>

    AuthType Basic

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>
```

P.S.

Sorry for the confusion. Off course I added the ip of the computers accessing it. 192.168.111 was only meant as an example  :Embarassed: 

----------

## c8a7w

did you ever get this solved? 

i'm currently having the same problem.

----------

## aronparsons

Did you try going over HTTPS?  The /admin section has the 'Encryption Required' directive set.

----------

## Kasumi_Ninja

 *c8a7w wrote:*   

> did you ever get this solved? 
> 
> i'm currently having the same problem.

 

I am sorry wasn't able to solve this   :Crying or Very sad:  I never tried https though.

----------

## c8a7w

after i posted here i found this thread

HOWTO CUPS+Samba: printing from Windows & Linux

and managed to solve it that problem.

i'm not really sure what solved it but its fixed, i am still having some problems to do with windows just printing blank pages tho   :Evil or Very Mad: 

edit: fixed that problem now, made stupid mistake.

----------

