After a long period of development in linux, many users are familiar with linux samba service sharing. Here I will share my personal understanding and discuss it with you.
Configure the server-side printer and Its Sharing:
1. the cups system is used to set up the printer. If you are using Ubuntu or other silly Linux systems, cups should have been installed and started by default, all you need to do is configure it. Skip to step 2. I only want to talk about the releases I have used: gentoo and archLinux. The advantages and disadvantages of these two releases will not be discussed here. They can only be said to be excellent releases. For gentoo users, installing and starting cups is simple:
# Emerge-av cups
# Rc-update-a cupsd default
If you use archLinux:
# Pacman-S cups
# Vim (or other editors)/etc/rc. conf
Add cups to the DAEMONS line.
2. now, we can configure and test our printer. I am using a usb interface printer of the HPLaserJet1200 and use the udev System for newer kernels ), the printer can be identified immediately after it is plugged in, unless your kernel does not support usb !, If you want to see if it is recognized, you can use the following command:
# Lsusb (pci-utils software package needs to be installed) or view dmesg:
# Dmesg | grep usb
If it is just inserted into the computer, it can also be like this:
# Dmesg | tail
If your printer uses other interfaces that are not supported by the system kernel, obtain Kernel support to load related modules or directly compile them into the kernel. In this case, you may need other help.
Now we need to configure cups. cups provides a web-based configuration interface, which is too convenient for desktop users. If you cannot install the desktop system, I'm sorry, it is not helpful for the time being. Make sure that the cups service process is started. Enter localhost: 631 in the browser, whatever you like, and I will use firefox. The cups configuration interface will be started! I'm sorry for those who are not familiar with English, because this interface does not seem to have been written into Chinese.
Click "add printer" to add a printer. after entering the next page, enter "name", "location", and "description" to fill in the blanks. In fact, they can all be left blank, of course, name is the name of the printer. Just select a professional and memorable name. location describes where the printer is hanging on yourself. I will write localhost ), discription is the description of the printer. It can be empty. Click "continue" to go to the next page.
In this step, select the printer. If you have found your printer according to the previous instructions, click the drop-down menu, there must be one of your printers. Choose it and then continue.
This step is to select the driver. Generally, the system already has your printer driver and recommended a few for you. You can choose the most similar one based on the recommended ones ), if your printer driver is not provided, you need to go here and check, search for your printer driver, download the corresponding ppd file, store it, and Click browse... manually add a driver. After adding the driver, the next step is "add printer"
Enter the root user name and password, and press enter. Congratulations! The printer has been added successfully! At this time, you should print a test page to see if the printer is not working.
3. After cups configuration is complete, you also need to start the linux samba service to share the printer. First of all, install samba and start the samba service. The method is similar to installing cups. However, before the linux samba service is shared and started, configure/etc/samba/smb. conf. Samba provides a default configuration file in/etc/samba/smb. conf. default may be another location, generally one). You can copy it as your configuration file template and make some modifications. Configuration methods are available on the Internet in a variety of ways. However, to share a printer, you only need to set the following lines:
[Global]
Workgroup = yourgroupname
Server string = abc
Security = share
Load printers = yes
[Printers]
Comment = All Printers
Path =/var/spool/samba
Browseable = no
Guest OK = no
Writable = no
Printable = yes
After the configuration is complete, start linux samba service sharing. The manual startup method is as follows:
#/Etc/init. d/samba restart
If it is arch, put the Service Startup Script under/etc/rc. d.
Finally, add samba to the startup process, and the server configuration is complete.
The following describes how to configure the client:
1. the configuration of the Windows client is very simple. directly in the "printer and fax" in the Start Menu, click "Add Printer" and select "network printer... "Then browse the printer, find a computer that is the same as the server string set on the previous server, click the following, the shared printer will be pulled down, select it, install, at this time, the system will prompt you to install the print driver. In the pop-up list window, select the printer manufacturer, then the printer model on the side, and then install the driver. After a short while, it will be OK! The newly installed printer may display access denied and cannot be connected. Ignore it. This is because samba has disabled browsing and does not affect printing. Next, test. If OK, congratulations.
2. the configuration of the Linux client is a little complicated, that is, cups and sambasamba may not be required, but have not been tested). When adding a printer to cups, select "Windows printer via samba" when selecting a printing device, and then ask you to enter the location in the network on the next interface. Because we share it through the linux samba service, of course we use smb: // It started, but how to write it later has been difficult for me for a long time. Now I know a trick:
Use smbclient:
$ Smbclient-L (server string)
Server string is the name of the samba server previously set.
All resources shared by the server are listed. Find the printer and write down its name, for example, my name is "maid", so that my location is like this: smb: // (server string)/maid. In Linux, user authentication may be required if no guest user exists. In this case, it is best to add a user account to the Linux user on the server side and add this account to the samba User:
# Smbpasswd-a username
In this case, you need to write the user name and password in the location, such as smb: // username: passwd @ (server string)/maid. Other configurations are the same as those on the server.
- Linux father Linus thumbs up to Windows 7
- Linux cluster Load Balancing
- A comprehensive introduction to GNU/Linux Programming Concepts
- Brief introduction to basic linux Debian knowledge
- Detailed anatomy of Linux Process Management