기본 콘텐츠로 건너뛰기

우분투에 연결된 프린터, 스캐너를 윈도우즈에서 공유하여 사용하는 방법



[Sharing Printer and Scanner through Network]

전제조건 (사용환경)

복합기가 연렬되어 프린터와 스캐너 서비스를 공급할 대상 : Ubuntu 16.10 (Yakkety Yak) 64bit
공유된 프린터와 스캐너를 사용할 대상 : Windows 10 64bit
사용 중인 복합기 : Canon-MX318 (PIXMA MX310 Series)

Server-side setup

$ sudo apt update
$ sudo apt-get install cupsys cupsys-client xinetd
$ sudo apt-get install samba smbfs swat
$ sudo dpkg-reconfigure xinetd
$ sudo apt install cups cups-pdf xsane sane-utils xscanimage gscan2pdf
$ sudo adduser saned lp
$ sudo gedit /etc/cups/printers.conf

웹브라우저의 http://snjee-nb2-ubuntu:631 에서 설정된 내용들이 표시된다.


$ sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original
$ sudo chmod a-w /etc/cups/cupsd.conf.original
$ sudo gedit /etc/inetd.conf


sane-port stream tcp nowait saned.saned /usr/sbin/saned saned
$ sudo touch /etc/xinetd.d/saned
$ sudo gedit /etc/xinetd.d/saned


service saned
{
socket_type = stream
server = /usr/sbin/saned
protocol = tcp
user = saned
group = scanner
wait = no
disable = no
}
$ sudo gedit /etc/default/saned


기본값이 no 인데, 이것을 yes 로 변경
RUN=yes
RUN_AS_USER=saned
$ sudo gedit /etc/cups/cupsd.conf


Order allow,deny
Allow localhost
Allow 192.168.0.*
Allow all


$ sudo gedit /etc/samba/smb.conf


[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=root snjee


[Canon-MX310-series]
comment=Cannon MX318 Printer
printer=Canon-MX310-series
path=/var/spool/samba
printing=cups
printable=yes
### Parsing Error printer admin=root snjee
### Parsing Error user client driver=yes
# to allow user 'guest account' to print
guest ok = no
writable = no
write list = root snjee
valid users = root snjee
$ sudo gedit /etc/sane.d/saned.conf


맨 아래 줄에
192.168.0.0/24 추가함.
$ sudo systemctl restart cups.service
$ service cups restart
$ service saned start
$ sudo service smbd restart
$ sudo service nmbd restart
$ cat /etc/services | grep sane


sane-port 6566/tcp sane saned # SANE network scanner daemon
$ scanimage -L


device `pixma:04A91728_441E10' is a CANON Canon PIXMA MX310 multi-function peripheral
$ sudo /etc/init.d/xinetd restart
$ sudo service saned start
$ sudo update-rc.d saned defaults












[Scanner 관련 설정 : Ubuntu]

$ sudo apt-get install libsane-extras



The user 'saned' is member of 'scanner'
$ sudo adduser saned scanner



All computers need to have Sane installed:
$ sudo apt-get install sane



As saned does not automatically detect a scanner that is shared by a remote computer you will need to set it up with both, the server and the client.



1. Tell it to run sane as a server (daemon, service)

Set sane to run as a server, ie expect connections Edit /etc/default/saned to read:
# Set to yes to start saned
RUN=yes












2. Set the subnet where to share the scanner.

Set the subnet that will be able to see the scanner Edit /etc/sane.d/saned.conf to share the printer on your subnet:
192.168.0.0/24
Make sure it is in your range of IPs. It hit me badly when I mis-configured it for 192.168.0.0 when I meant 192.168.0.0 !
The /24 means to share with everybody in xxx.xxx.xxx.0 to 255.



3. User setup

In some cases, correct permissions needs to be set. E.g. for Canon PIXMA MX310 device, the saned user has to be inserted into lp group. To do that by typing
$ sudo adduser saned lp
To verify the saned user has the correct permissions to access the scaner device, run the following commands:
$ sudo -s
$ su -s /bin/bash saned
$ scanimage -L
As a result, you should see a device identified, e.g.
device `pixma:04A91728_441E10' is a CANON Canon PIXMA MX310 multi-function peripheral



4. restart inetd or xinetd by

$ sudo /etc/init.d/xinetd restart



5. Run at start-up

$ sudo service saned restart

6. To configure the Sane daemon to start automatically at boot up run:

$ sudo update-rc.d saned defaults



[Client-side Setup : Ubuntu]

From the client, all you need to do is add server name or IP address of the scanner server to /etc/sane.d/net.conf:
Server IP Address






[Client-side Setup : Windows]

프린터의 경우,
Windows에서
제어판 → 하드웨어 및 소리 → 장치 및 프린터 → 프린터 추가
장치 추가 대화상자에서, “원하는 프린터가 목록에 없습니다” 선택
프린터 추가 대화상자에서
이름으로 공유 프린터 선택”
http://snjee-nb2-ubuntu:631 입력하여 Canon-MX310-series 선택하면 됨
스캐너의 경우,
을 받아서,
바탕화면에 ScanImange 를 실행하여
Settings 에서
Hostname : snjee-nb2-ubuntu
Port : 6566
Username : saned




댓글

이 블로그의 인기 게시물

VIDEO_DXGKRNL_FATAL_ERROR on Windows 8.1

Windows 8.1 로 업데이트 이후, Booting 시 Blue Screen 이 뜨면서, VIDEO_DXGKRNL_FATAL_ERROR 또는 SYSTEM_SERVICE_EXCEPTION (atikmpag.sys)  가 발생하는 문제점이 있을 때, 아래와 같이 조치해 보십시오. 제어판 -> 전원 옵션 -> 설정 변경 덮개를 닫으면 수행되는 작업 선택 -> 현재 사용할 수 없는 설정 변경 -> 종료 설정 -> 빠른 시작 켜기(권장)의 Check Box 를 해제함.

Ubuntu (Kubuntu) 에 desktop 파일 만들기

Package 관리자등을 통해 직접 Repository 에 있는 Application 을 설치하는 경우에는 필요한 경로와 파일, Category 로 분류된 Icon 등록 등이 자동적으로 이루어지나 firefox, eclipse 등 새로운 버전을 새로 설치할 경우, 다음과 같은 절차를 통해 시작메뉴에 등록시킬 수 있다. 다음은 eclipse-SDK-3.6-linuxx-gtk.tar.gz 을 받아 설치 등록하는 것을 예로 든다. 1. 다운받은 파일을 /usr/lib에 압축해제한다. (물론, super user 계정으로 실행해야 한다.) 2. 보통의 경우, /usr/bin Directory 는 PATH 에 물려 있으므로 다음과 같은 실행 파일을 만들어 놓는다. # cd /usr/lib # chmod +x eclipse # cd /usr/bin # sudo nano eclipse eclipse 파일에는 아래의 내용을 입력하여 넣는다. export ECLIPSE_HOME="/usr/lib/eclipse" $ECLIPSE_HOME/eclipse $ * # sudo chmod 755 eclipse 3. Desktop Menu 에 추가하려면 # cd /usr/share/applications # sudo nano eclipse.desktop [Desktop Entry] Encoding=UTF-8 Name=Eclipse Comment=Eclipse IDE Exec=eclipse Icon=/usr/lib/eclipse/icon.xpm Terminal=false Type=Application Categories=GNOME;Application;Development' StartupNotify=true 이렇게 입력한 파일을 저장하면, 시작메뉴 > 개발 > Eclipse 아이콘이 생성되어 메뉴에서 직접 실행할 수 있게된다.

네트워크 상의 IP 주소로 MAC 주소를 추출하는 방법

Subject :  How can I get a list of MAC to IP addresses on the network? An easy way to get a list of MAC to IP addresses on the local subnet is to ping every host on the subnet and then check you ARP cache, however pinging every individual node would take ages and the entries only stay in the ARP cache for 2 minutes. 로컬 서브넷 상의 IP 주소에 대한 MAC 주소 목록을 획득하는 쉬운 방법은 서브넷 상의 모든 호스트에게 Ping 을 하고 ARP(Address Resolution Protocol) 캐쉬를 확인하는 것이다.  그러나, 모든 개별 노드에 Ping 하는 것은 많은 시간이 걸릴 것이고 2분동안만 ARP 캐쉬에 체재하면서 들어갈 수 있다. (참고) ARP 캐쉬는 Linux 의 경우 20분, Windows Server 의 경우 2분이 기본적인 Life Time  이다. 그 이후에는 그 데이타가 지워진다. An alternative is to ping the broadcast mask of your subnet which will ping every host on the local subnet (you can't ping the entire network as you only communicate directly with nodes on the same subnet, all other requests are via the gateway so you would just get a ARP entry for the gateway). 로컬 서브넷상의 모든 호스트를 Ping 하게 될 사용자의 서브넷 브로드캐스트 마스크를 Ping 하는 것이 또 다른 방법이다.(동일 서브넷 상의 노드와 직접적으로