CompTIA Linux+ XK0-005 – Unit 10 – File Sharing and Printing part 2

  1. Demo – Managing Exports

All right, we are going to kind of repeat history a little bit. We’re going to mount our neighbors file system that they’re exporting that was at the Debian system, their home folder. And this time I’m just going to put it in our mount directory LS mount just to make sure trainer is there so we have that connection. And I know it sounds kind of crazy, we put it in, take it out, but that was to show you the full round of what’s happening. Now what I’m going to do is I’m going to go over next door to the Debian system and we’re going to type in the command show mount and there it says, oh, I can’t get an address for Debian. Actually what I wanted to see here, I’m sorry, was the export FS to see what we’re exporting. So there I get the idea of seeing what we’re exporting and in fact, I can even do the exports FS with the verbose connection so I can kind of see all of the issues or all of the options they have.

Obviously we’re sharing this with Fedora. That’s the host name next door and it’s a read only system. So let me switch back to Fedora. Okay, now we’re going to do the show mount so we can see the hosts that we are connected to. We’re going to do the A and basically it says all mount points are on Fedora. So that works out and it’s, again, just trying to give us an idea of some of the commands of what we’re doing. So here we’re able to see that we do have some mounts, we know that we have it set up and I was able to go over to the other location and do the exports FS for the file system to see what we’re running.And now I’m going to see if we can do a couple of other little quick things here.

Now what we’re going to do is we’re going to go back to our exports file system command and we’re going to do the Au to see if we can Unexport everything that we’re doing and we’ll try the show mount again with the a and can’t get any address for Debian. All right, so it’s basically saying that it looks like they’re still connected. I mean, we see the name Debian, but they should be pretty much gone because of the way we set that up. We said you’re gone and that means that they shouldn’t be connected, but they still have that session back and forth. But let’s take a look at some of the options as far as coming back over here to Fedora. And now here on Fedora, what we’re going to do is we’re going to LS the mount folder and there we go.

Now we’re getting permission denied. And the reason we’re getting that permission denied is because again, we just killed it on the other side. So we actually no longer even have our read only connectivity. All right, so it’s, again, just showing you that you can look at a couple of commands to see who’s connected, where you’re connected to little things you can do to shut them down if you want to. You have kind of a full range. And of course, we did all of this through the command line to show you the easy access that you have in setting these things up pretty quickly and shutting them down and investigating. So that’s just kind of an introduction anyway, to the ways in which you can manage your shared folders. To NFS.

  1. Topic B: Printing

Now, one of the other resources, of course, besides files, is printing. And that’s a very common thing. In fact, there was a time when that was like the number one complaint that people had. Printer is not working. I can’t get the print today. It’s email. But that’s another topic for us. So we’re going to talk about the printing. And if I have a local printer attached to my machine, how to make sure that you can use it if you want, or vice versa.

  1. Printing

All right, so there are a number of different protocols that can help us in being able to communicate with Linux to the printer itself. One of the older protocols we used was called the LPD LPR, which was the line printer daemon. Now, it wasn’t the best that was out there. In fact, many different companies thought it was so horrible that they wrote their own application specific printing capability, abilities or drivers to communicate to the print devices like WordStar, which maybe some of you have never even heard of. But before there was office, before there was Word Perfect, there was word star. In fact, before WordStar there was many other things but anyway, they wrote their own word perfect had one as well. Well, today generally we use what’s called cups, the common Unix printing system. It’s almost always installed by default on every machine and it’s there without you having to install a package or anything else.

Now, when we talk about these printing communications we have kind of a common set of names that we use. For instance, a printer is not the thing you think it is. It’s not the box where the paper comes spitting out. That’s called the device. Some people call it the print device. The printer is the visual representation on Linux that represents its connection to the print device. Now, the thing that you’re printing the paper, the actual commands go print this that’s considered a job. So if you are printing a document, you have created a job for the printer. And if I have multiple jobs waiting, they’re waiting in queue. A nice, fancy, good English word, word for line. Anyway, those are the components that we’re going to talk about. And remember that when I say printer, it is a representation of a physical device, that device being the thing that’s printing the actual images or words on paper.

  1. LPD/LPR

All right, so the LPD LPR, as I said, was our traditional printing systems that had very limited features. And back when it was designed, it was probably just fine, but by today’s standard, is just riddled with security problems. And it has so many holes that we basically say, you know what? Don’t even try it. And besides, by today’s standards, it also doesn’t deal well at all with graphics if you use it. It had simple commands. I’m not even going to get into very much, but commands like LPR was how we would print a document. LPC would let us view the status of a printer. LPQ lets us see what jobs were in queue. Lprm remove allowed us to remove print jobs from the queue. Very rudimentary commands.

  1. Application Specific

As I said, there were many applicationspecific, types of printers or drivers, if you would, that were designed by the companies who wanted to operate and work with Unix or Linux, for instance. I said WordPerfect. I said WordStar. Part of Star office. These were programs that used to be WordPress still is, by the way, very commonly used, but it doesn’t have the same heydays it did back ten years ago. Anyway, they wrote their own programs for their applications to work with printers to deal with the limitations that you had with LPR and LPD.

 18. CUPS

All right, so that moves us to Cups. Cups is again, that common Unix printing system that we use. It is the default for all of our modern printing systems. It has many improved options. Graphics are taken care of, your security issues have been addressed. And of course, if new ones come up, we have broad support for designing new fixes and patches to those. It’s almost always installed by default whenever you install the Linux operating system. So it’s ready for you to use. All you have to do is worry about the configuration files or the configuration of actually making it talk to a print device.

  1. GUI Tools

So if we take a look at the GUI tools, you’ll see that they’re pretty straightforward. We’re going to go to the printers configuration and we’re going to say we’re going to add this new printer and it’s going to ask us for information, descriptions, locations, URLs, make and model. It’s stuff that we are used to seeing from a Windows system. Now, we can also have policies, access control, any other specific printer options, job options, lots of things that we can do. But remember that we are configuring a printer. A printer is the graphical representation or the virtual representation of the print device itself. Anyway, you fill in the blanks, you follow the settings, and when you’re done, you click OK and you have a new logical connection to a print device.

  1. More on Printing

So when it comes to actually sending a print job, you can do that with most of the applications that you run today on Linux. That means that you open up some sort of word document or document editor, spreadsheet, designer and within there some toolbar, some file menu option you’re going to be able to print and it will print to whichever printers you have installed on that Linux box. You can still though print with the command line just like you had in the LPR. LPD with an LP command. Now some of you may prefer the LP command to print rather than opening up a whole application, opening up a specific document and trying to print it. But again, you’ve got that flexibility.

  1. Demo – Creating a Printer in CUPS

All right, we are going to create a printer here and take a look at some of the options we have. So I’m going to go to System Administration and Printing. Now, I want you to know we don’t have a real print device here in our lab, so we’re just going to ask it to pretend. Making sure I log in is the root here as it’s asking. And we’re going to click on New Printer. All right? So as it searches, it sees it that we don’t have any. And what we’re going to do is choose the LPD host or printer as our option. And we’re going to select a dummy, basically for making that connection. So from here we’ve selected this option. And let’s see in the queue we’re going to choose dummy and in the host, I think we’re going to stick with local host because we’re going to manage it locally.

Here where we’re at. But I am not going to probe for this because like I said, it doesn’t really exist. All right, so I’m going to forward this or hit Forward to go to the next page and let’s make it well, see, I guess HP still makes a popular printer. So we’ll choose the HP printer and click Forward and we’ll choose the Business Inkjet 1000. I’m sure that’s age is old, but we’ll still choose it. And then we have the option here to create some names for it. I’m going to call it my Printer. And you can tell I’m not too original with my names here and the description. Of course, I’m going to call it the Pretend Printer. And this will be on the Pretend Printer cable. So we have none of that stuff here available for us.

So we’re just putting that all in. And again, you have to remember that the printer itself is an icon that we’re creating that would supply the drivers to talk to the print device. We just don’t have the actual print device. If we actually try to send something to the printer, we’d eventually get back an error that says it couldn’t connect to the print device. All right, so so far so good in creating that particular printer. Now let’s see if we can get to it through the Internet. I’m going to go to applications. Internet ice Weasel And again, we’re going to try to do little the Web browser to help us with some of that administration. We’re going to cheat. We’re going to type in local host because we know there’s a host file entry for us. And we’re going to use port 631.

That’s what the Colon 631 does for us. Hit Enter. And there’s the common Unix printing system, what we call Cups. Now from there I’m going to click on Manage Printers, and if I had a little bit better resolution, you probably see this a lot easier. But now that I’m here, I can work with if I had one, I could print a test page, stop it, reject jobs. So if people started sending print jobs in, I could actually start looking at them, seeing the jobs in this little let me scroll this over a little list and all those options. But again, this was a way of being able to manage printers. And this is really good. If I wasn’t directly connected to this print server, I could be doing this to the Internet from some other location in the world, if I’m allowed to. And I can manage this thing and do all sorts of other types of configurations.

Like I said, if I actually click on print test page, I expect there to be a problem and error because it doesn’t exist. And at some point it will tell me that when it comes back, I’m going to say, click on show all jobs. See if there are any jobs in there. No. Let’s show completed jobs. So no jobs. I keep forgetting I have to go here to the middle of the page. Let’s try to show all jobs and go down a little bit. And so here’s the one job that I did send. And of course, if I didn’t like this particular job, I could kill it. All right? So that’s a quick rundown of installing a printer. Did that graphically managing it through the web page, through the web services that are available to you. And hopefully, it seems to be very straightforward and easy to figure out.

  1. Printing Management

Now, while you’re dealing with printing, one of the issues you have is managing the queues. How many jobs are stuck there or that you’re waiting on. Like many other types of printing or daemons that are running, sometimes you need to reboot the thing. I mean, it happens. But here’s what we look at. Commands like LP Stat or LPQ will allow you to view the jobs that are in queue. The cancel command will allow you you to remove those jobs that maybe are jammed. Stuck. Now, when I say jammed, I don’t mean like a paper jam on a device, but I mean somehow, for some reason in the software, it just isn’t going anywhere. So it’s almost like a little roadblock. You remove it on yourself. Or, of course, you can go right into the actual cups, the cups daemon config file and take a look at managing queues.

From there, you can restrict who can use this number one through the GUI when you created the printer, or later through the LP admin command. The same LP admin will also allow you to set a printer as a default printer. LP options will allow you to change options that may be specific to the actual print device that you use, like paper size and all that sort of stuff, or any other environmental variables like display or other things that you can change. You can do that as well through your command line. Everything I just mentioned, though, can also be dealt with through the GUI. And as I said, it seems to be more the norm that we deal with our printers through the Gui’s than we ever do through the command lines.

  1. Demo – Managing Printers

Okay, we’re at the terminal window and we’re going to take a look at using the command line to do a little work with managing printers. Now, I know some of you probably have seen already the example of using the web page and you’re probably thinking yourself, you know, that sounded good to me, but that’s always good to know how to do things through the command line. So now what I’ve done is I’ve typed LPQ, and this is showing me the status of jobs. And I have one in file. It was originally supposed to be a test page. And since I don’t actually have a printer there, it’s going to stay there. It’s not going to ever make it out. So it’s the first job that’s in queue. And there’s another command that you might like, the LP Stat. And the name of this printer was called my printer.

So I’m going to type in the name of that. And there’s the status of this particular printer again. It’s got that one job in there. The owner is anonymous, tells me that it’s still up. I mean, as far as we know, this thing is up and running. It just has this job sitting in there. So we’re going to try to cancel out that job and we’re going to try to cancel all of the print jobs with a cancel command of A. And now we’ll do the LPQ and the printer is ready and there’s no entry. So we got rid of all of that stuff. All right, so now we want to basically configure the system to deny user accounts the rights to print to the printer. And that’s pretty straightforward. That means I’m not going to let trainer print to the printer and we’re going to do that with this LP admin command.

So LP admin has a dash P for the printer. So I put in the name of the printer print device, or actually printer is the command that you see the icon you would see in the GUI, the U for the user and the permission which is deny colon trainer. So we’re going to deny the trainer press Enter. And now that we’ve got that done, we’re going to say basically, trainer can’t make any changes. Now, if I do a who am I? You’ll see, I’m actually the root at the moment, but if I did try to get in as the trainer and make the print, I would be told, no, you can’t do it. Now, I’m going to also make some changes here. We’re going to try another command, the LP admin. This time let’s do something different with the permissions on the printer, my printer.

And in this case for the user, we’re going to use the permission allow and we’re going to give that to everyone. So that’ll configure our system to allow basically all the users to print. Boom. So these commands are really not that hard to figure out. LP stat for the status LPQ to see what’s in queue, a cancel command, in this case, the Dash A to cancel everything, and a few LP admin commands to change permissions and some other kind of cool stuff you can do with those as well. Let me minimize this down for just a second. We’re going to go into system administration and printing. And what we’re going to do here is we’re going to take a look at this printer. So I’m going to click on the printer itself, right click it and go to Edit. And from Edit, I’m going to go to Access Control.

And you can see that it says right here, allow printing for everyone except for these users. And that’s because the last thing I did was I changed it to give everybody the permissions that we wanted. And so that pretty much shows up. I don’t have a list of users that I’m going to deny permissions to. I would have had I left my previous command about denying the Trainer account. All right, so that lets us see all of those types of options as well. And I’m going click on Cancel and I’ll close this down. And that’s giving you kind of an idea of how you can go around and playing with the command line to also manage your printer.

  1. Unit 10 Review

All right, so in this unit, we talked about remote access for files, whether we’re connecting to somebody’s files or having them connect to us. We also talked about dealing with your printers, being able to manage them through the web pages, through the Gui’s to set them up, and all of the things that are important to us for most everyday systems. File sharing and printing, that seems to be very common right up there with email. So that was is our goal is to make sure you understood how NFS works, how the configuration of a file that you want to share is available to other people, what you need to do to set it up.

The permissions, the users methods of being able to list multiple users and or if you wanted to mount somebody’s exported file into your file system, how you would be able to handle that? And then again, the printer stuff. So that we understood the differences from the old style methods of managing printers to the newest Cups program that we use, or protocols for communications, and all the settings that you need to be able to set that up. Options, users restrictions, all that kind of cool stuff. Anyway, that was our goal. I think we covered most of that. You saw some examples as well. And you should be able to go forward and be able to set up your own shares or connect to your shares that you have out in the network.

 

 

 

img