Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
CUPS/プリンター共有のソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
CUPS/プリンター共有
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:プリンター]] [[en:CUPS/Printer sharing]] [[ru:CUPS/Printer sharing]] [[zh-hans:CUPS/Printer sharing]] {{Related articles start}} {{Related|Samba}} {{Related|CUPS}} {{Related articles end}} この記事では GNU/Linux システム間、あるいは GNU/Linux システムと Microsoft Windows の間でプリンターを共有する方法を説明しています。 ==GNU/Linux システム間== サーバーはウェブインターフェイスを使用するか {{ic|/etc/cups/cupsd.conf}} を手動で編集することで設定できます。クライアントの設定については、[[CUPS#ローカルの CUPS サーバーを使わない]]を見てください。 ===ウェブインターフェイスを使う=== サーバーのウェブインターフェイスを開いて、''Administration'' タブを選択肢、''Server'' の下にある "Share printers connected to this system" オプションを有効にしてください。''Change Settings'' ボタンを押すことで変更が保存され、サーバーは自動的に再起動します。 複雑な設定を行いたい場合、''Edit Configuration File'' を選択することで直接 {{ic|/etc/cups/cupsd.conf}} ファイルを編集できます。詳しくは[[#手動セットアップ]]を見てください。 ===手動セットアップ=== サーバー側のコンピュータ (プリンターに直接接続するコンピュータ) で、location ディレクティブを編集してサーバーへのアクセスを許可してください。例: {{hc|/etc/cups/cupsd.conf| <Location /> Order allow,deny Allow localhost Allow 192.168.0.* </Location> ... }} また、クライアントが使用する IP アドレスでサーバーが待機するようにしてください: {{hc|/etc/cups/cupsd.conf| ... Listen <hostname>:631 ... }} 自動的に設定する方法など、詳しい解説は [http://localhost:631/help/network.html Using Network Printers] を見てください。 編集したら、CUPS を再起動してください。 ソケットアクティベーションを使って CUPS を起動している場合、{{ic|org.cups.cupsd.socket}} の[[systemd#ドロップインファイル|ドロップインファイル]]を作成してリモート接続でもソケットアクティベーションができるようにしてください: {{hc|/etc/systemd/system/org.cups.cupsd.socket.d/override.conf|<nowiki> [Socket] ListenStream=631 </nowiki>}} ===ブラウジングの有効化=== ブラウジング (共有プリンターの探知) を有効にするには、サーバーに [[Avahi]] をインストールして起動する必要があります。プリンターの探知が必要ない場合、サーバーとクライアントには Avahi が必要ありません。 {{Note|cupsd が起動する前に [[Avahi]] が立ち上がっていないとブラウジングは機能しません。}} ブラウジングを有効にするには、ウェブインターフェイスで ''Share printers connected to this system'' を選択するか、手動で Browsing をオンにして BrowseAddress を設定してください: {{hc|/etc/cups/cupsd.conf| ... Browsing On BrowseAddress 192.168.0.*:631 ... }} ==GNU/Linux と Windows== ===Linux サーバー - Windows クライアント=== ====IPP で共有==== Windows クライアントを Linux の印刷サーバーに接続するとき推奨される方法は [[wikipedia:Internet_Printing_Protocol|IPP]] です。HTTP に基づく標準的なプリンタープロトコルであり、ポートフォワーディングやトンネリングなどから様々な恩恵を受けることができます。設定はとても簡単で Samba を使う方法より楽です。IPP は Windows 2000 以降の Windows でネイティブでサポートされています。 {{Note|Internet Printing Client を Windows に追加する必要があるかもしれません (''Control Panel->Programs->Turn Windows features on or off->Print and Document Services'')。}} まず、[[#GNU/Linux システム間]]に書かれているようにサーバーを設定してください。 Windows コンピュータ側で、''Control Panel->Devices and Printers'' から 'Add a printer' を選択します。次に、'Select a shared printer by name' を選んでプリンターの場所を入力してください: http://''hostname'':631/printers/''printer_name'' ''hostname'' は GNU/Linux サーバーのホスト名や IP アドレスに、''printer_name'' は接続されているプリンターの名前に置き換えてください。サーバーの完全修飾ドメイン名を使うこともできますが、{{ic|cupsd.conf}} で {{ic|ServerAlias my_fully_qualified_domain_name}} を設定する必要があります。 {{Note| * The 'Add Printer' dialog in Windows is sensitive about the path. The dialogue box suggests the format {{ic|<nowiki>http://computername/printers/printername/.printer</nowiki>}}, which it will not accept. Instead, use the syntax suggested above. * If you are using '''proxy''' - check used proxy '''exclusions''' twice - it may result in failing to add a printer until reboot even if you will disable proxy at all afterwards (actual for Windows 7).}} 設定後、Windows コンピュータにプリンターのネイティブなプリンタードライバーをインストールしてください。CUPS のプリンタードライバーを使用するように CUPS サーバーを設定している場合、Windows クライアントでは汎用の postscript プリンターを選択します (例 'HP Color LaserJet 8500 PS' や 'Xerox DocuTech 135 PS2')。テストページを印刷してみて印刷設定をテストしてください。 ====Samba で共有==== If your client's Windows version is below Windows 2000 or if you experienced troubles with IPP you can also use Samba for sharing. Note of course that with Samba this involves another complex piece of software. This makes this way '''more difficult to configure''' and thus sometimes also '''more error-prone''', mostly due to authentication problems. To configure Samba on the Linux server, edit {{ic|/etc/samba/smb.conf}} file to allow access to printers. File {{ic|smb.conf}} can look something like this: {{hc|/etc/samba/smb.conf|2= [global] workgroup=Heroes server string=Arch Linux Print Server security=user [printers] comment=All Printers path=/var/spool/samba browseable=yes # to allow user 'guest account' to print. guest ok=no writable=no printable=yes create mode=0700 write list=@adm root yourusername }} That should be enough to share the printer, yet adding an individual printer entry may be desirable: {{hc|/etc/samba/smb.conf|2= [ML1250] comment=Samsung ML-1250 Laser Printer printer=ml1250 path=/var/spool/samba printing=cups printable=yes printer admin=@admin root yourusername user client driver=yes # to allow user 'guest account' to print. guest ok=no writable=no write list=@adm root yourusername valid users=@adm root yourusername }} Please note that this assumes configuration was made so that users must have a valid account to access the printer. To have a public printer, set ''guest ok'' to ''yes'', and remove the ''valid users'' line. To add accounts, set up a regular GNU/Linux account and then set up a Samba password on the server. For instance: # useradd yourusername # smbpasswd -a yourusername <!-- After setting up all the needed user accounts, the samba spool directory also needs configuration: {{bc| # mkdir /var/spool/samba # chmod 777 /var/spool/samba }} The next items that need changing are {{ic|/etc/cups/mime.convs}} and {{ic|/etc/cups/mime.types}}: {{ic|mime.convs}}: {{bc| # The following line is found at near the end of the file. Uncomment it. application/octet-stream application/vnd.cups-raw 0 - }} {{ic|mime.types}}: {{bc| # Again near the end of the file. application/octet-stream }} The changes to {{ic|mime.convs}} and {{ic|mime.types}} are needed to make CUPS print Microsoft Office document files. Many users seem to need that. --> After this, restart the Samba daemon. Obviously, there are a lot of tweaks and customizations that can be done with setting up a Samba print server, so it is advised to look at the Samba and CUPS documentation for more help. The {{ic|smb.conf.example}} file also has some good samples that might warrant imitating. ===Windows サーバー - Linux クライアント=== {{Warning|Any special characters in the printer URIs need to be appropriately quoted, or, if your Windows printer name or user passwords have spaces, CUPS will throw a "lpadmin: Bad device-uri" error. For example: {{ic|smb://BEN-DESKTOP/HP Color LaserJet CP1510 series PCL6}} becomes: {{ic|smb://BEN-DESKTOP/HP%20Color%20LaserJet%20CP1510%20series%20PCL6}}. This result string can be obtained by running the following command: $ python2 -c 'import urllib; print "smb://" + urllib.quote("BEN-DESKTOP/HP Color LaserJet CP1510 series PCL6")' }} ====LPD で共有==== Windows 7 には LPD サーバーが組み込まれています。それを使うことでクライアントに ''Samba'' をインストールしたりサーバーで様々な設定を行うことなく簡単に共有が可能です。''Control Panel'' を開いて ''Programs'' -> ''Activate Windows functions'' の ''Print services'' から有効にできます。プロパティによってプリンターの ''shared'' を有効にする必要があります。共有名には空白なカンマなどの特殊文字を使用してはいけません。 それから CUPS からプリンターを追加できます。LPD プロトコルを選択してください。プリンターアドレスは以下のようになります: # lpd://windowspc/printersharename プリンターを追加する前に、使用しているプリンターにあわせて適切なプリンタードライバーをインストールする必要があります。Generic PostScript や RAW ドライバーで動作するかもしれません。 ====IPP で共有==== As above, IPP is also the '''preferred''' protocol for printer sharing. However this way might be a bit '''more difficult''' than the native Samba approach below, since you need a greater effort to set up an IPP-Server on Windows. The commonly chosen server software is Microsoft's Internet Information Services (IIS). {{Note|This section is incomplete. Here is a description how to set up IIS in Windows XP and Windows 2000, unfortunately in German [http://www.heise.de/netze/artikel/Ueberall-drucken-221652.html]}} ====Samba で共有==== A '''much simpler way''' is using Window's native printer sharing via Samba. There is almost no configuration needed, and all of it can be done from the CUPS Backend. As above noted, if there are any problems the reason is mostly related to authentication trouble and Windows access restrictions. On the server side enable sharing for your desired printer and ensure that the user on the client machine has the right to access the printer. The following section describes how to set up the client, assuming that both daemons (cupsd and smbd) are running. =====ウェブインターフェイスを使って設定===== The Samba CUPS back-end is enabled by default, if for any reason it is not activate it by entering the following command and restarting CUPS. # ln -s $(which smbspool) /usr/lib/cups/backend/smb Next, simply log in on the CUPS web interface and choose to add a new printer. As a device choose "Windows Printer via SAMBA". For the device location, enter: smb://username:password@hostname/printer_name Or without a password: smb://username@hostname/printer_name Make sure that the user actually has access to the printer on the Windows computer and select the appropriate drivers. If the computer is located on a domain, make sure the URI includes the domain: smb://username:password@domain/hostname/printer_name =====手動設定===== For manual configuration stop the CUPS daemon and add your printer to {{ic|/etc/cups/printers.conf}}, which might for example look like this {{hc|/etc/cups/printers.conf|2= <DefaultPrinter MyPrinter> AuthInfoRequired username,password Info My printer via SAMBA Location In my Office MakeModel Samsung ML-1250 - CUPS+Gutenprint v5.2.7 # <= use 'lpinfo -m' to list available models DeviceURI smb://username:password@hostname/printer_name # <= server URI as described in previous section State Idle Type 4 Accepting Yes Shared No JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 AllowUser yourusername # <= do not forget to change this OpPolicy default ErrorPolicy stop-printer </Printer> }} Then restart the CUPS daemon and try to print a test page. =====Windows 印刷サーバーの URI を確認===== Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username: $ smbtree -U ''windowsusername'' This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this: {{bc|WORKGROUP \\REGULATOR-PC \\REGULATOR-PC\Z \\REGULATOR-PC\Public \\REGULATOR-PC\print$ Printer Drivers \\REGULATOR-PC\G \\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}} What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter: smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series as the URI into CUPS. ==リモート管理== [[#GNU/Linux システム間]]に書かれているようにサーバーをセットアップしたら、設定によってリモートで管理することができます。管理を許可するホストを {{ic|/etc/cups/cupsd.conf}} の {{ic|<Location /admin>}} ブロックに追加してください。使用する構文は[[#手動セットアップ]]で説明されているものと同じです。3つのレベルで権限を与えることができます: <Location /> #access to the server <Location /admin> #access to the admin pages <Location /admin/conf> #access to configuration files リモートホストに与えたいレベルにあわせて、セクションに {{ic|Allow}} ステートメントを追加してください。{{ic|Allow}} ステートメントは以下の形式で使用することができます: Allow from all Allow from host.domain.com Allow from *.domain.com Allow from ip-address Allow from ip-address/netmask Allow from @LOCAL Deny ステートメントを使うこともできます。例えば、ローカルネットワークインターフェイスの全てのホストに完全な権限を与えてたい場合、{{ic|/etc/cups/cupsd.conf}} を以下のように編集: # Restrict access to the server... # By default only localhost connections are possible <Location /> Order allow,deny '''Allow from @LOCAL''' </Location> # Restrict access to the admin pages... <Location /admin> Order allow,deny '''Allow from @LOCAL''' </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny '''Allow from @LOCAL''' </Location> 以下の設定を追加することでリモートマシンから CUPS ウェブインターフェイスを使用した場合に起こる {{ic|426 - Upgrade Required}} エラーを止めることができます: DefaultEncryption Never ==トラブルシューティング== 一般的なトラブルシューティングについては [[CUPS/トラブルシューティング]]を見てください。 ====GTK アプリケーションで印刷できない==== GTK アプリケーションから印刷しようとすると "getting printer information failed" と表示される場合、{{ic|/etc/hosts}} に次の行を追加してください: # serverip some.name.org ServersHostname === Samba でプリンターを追加・編集できない === Samba を使ってプリンターを追加・編集しようとすると、インターフェイスによる CPU の使用率が 100% の状態が30秒も続いた後に以下のメッセージが表示される場合: Unable to get list of printer drivers: Success Gutenprint (https://bugs.archlinux.org/task/43708) の既知のバグが原因です。Gutenprint をアンインストールして foomatic-db だけをインストールしてください。次のコマンドで "Success" メッセージの代わりにドライバーのリストが返ってくるはずです: # lpinfo -m === Windows でパーミッションエラー === ユーザーによっては別の構文を使うことで 'NT_STATUS_ACCESS_DENIED' エラーが解決する場合があります (Windows クライアント): smb://workgroup/username:password@hostname/printer_name ==他のオペレーティングシステム== 他の印刷システムと CUPS を繋げる方法の詳細は CUPS マニュアルにあります。例: http://localhost:631/help/network.html
このページで使用されているテンプレート:
テンプレート:Bc
(
ソースを閲覧
)
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:META Related articles start
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:Note
(
ソースを閲覧
)
テンプレート:Related
(
ソースを閲覧
)
テンプレート:Related articles end
(
ソースを閲覧
)
テンプレート:Related articles start
(
ソースを閲覧
)
テンプレート:Warning
(
ソースを閲覧
)
CUPS/プリンター共有
に戻る。
検索
検索
CUPS/プリンター共有のソースを表示
話題を追加