SolutionBase: Integrating Fedora Core 5 with a Windows network

Connecting a Linux desktop workstation to a Windows-based network can be a challenge. In this article, Scott Lowe shows you to make Fedora Core 5 play nice in a Windows environment.

Even if you're installing Fedora Core 5 onto desktops in your organization, the chances are pretty good that you'll have need to integrate Fedora with your Windows systems in some way. While many Linux enthusiasts question the wisdom of running Windows-based servers, Windows continues to rule in the business world. In this article, I will address basic Windows integration needs.

About my lab configuration

For all of the examples in this article, I'm using Fedora Core 5 as a desktop operating system and Windows Server 2003 R2 at the server-side of the equation. The Windows server is named w2k3r2-ent-base. I'll primarily use a user account named sampleuser in Active Directory. This is a normal, non-administrative user account to which I will assign appropriate permissions for file shares and printer access.

Connect to Windows file shares

There was a day when Windows and Linux interoperability was somewhat (ok, significantly) harder than it is today. Now, much of the functionality to accomplish seamless integration is built right into Fedora. Let's start with an example that connects a Fedora desktop system to a file share hosted on Windows Server 2003 R2.

There are two methods by which you can accomplish your server connection goal:

  • Use the Connect To Server method.
  • Use the Browsing method.

The Connect To Server method

From the Fedora desktop, choose Places | Connect to Server (Figure A). This opens the Connect to Server dialog window (Figure B).

Figure A

The Connect to Server option gives you a place to specify exactly what you want to connect to.

The Connect to Server dialog window asks for a lot of information, but you don't need to do much with most of it. From the Service Type drop-down selector, choose Windows Share. The appropriate fields for connecting to a Windows server appear in the rest of the window. The only field that you have to specify is the name of the Windows server to which you would like to connect. Click the Connect button when you're ready.

Figure B

Type in the name of the server to which you would like to connect.

Before you can make use of the resources offered up by a Windows server, you have to provide some kind of authentication details so that the Windows server knows what rights you should be granted. On the Authentication Required window, provide these details. If you want to make this connection more easily accessible later on, select one of the two options in the window, as shown in Figure C.

Figure C

Enter authentication details on this screen.

If you provide the credentials for a user that has access to at least some resource, you will get a list of these resources, as shown in Figure D. In this screenshot, I have changed the default view. I don't like Icon View and much prefer List View, available by going to View | View As List.

Figure D

This is a list of the shares to which sampleuser has been assigned privileges.

The Network Servers method

Like Windows, Mac OS X, and pretty much every other modern operating system, Fedora Core 5 includes a network browsing feature, making it visually simple to find resources on your network.

To use this method, go to Places | Network Servers, and double-click on items that bring you closer to the resource you're trying to access. In Figure E below, I started with the Windows Network option in the first window, then chose the example2 workgroup, which is my lab domain, and was provided with the name of a server in that workgroup. If you've used Windows Network Neighborhood (or Network Places), you should be very familiar with this method.

Figure E

Follow the windows! If you've used Network Neighborhood, you see that this process is very similar.

At this point, double-click the server to which you would like to connect. After this, the Authentication Required window that you saw in Figure C opens up asking you to authenticate to this system after which you will see the resources you are allowed to access as shown in Figure D.

Connect to a Windows printer

Connecting to a Windows printer is similar to the process of connecting to any other network-based printer, an effort you saw outlined in the previous article in this series. For this example, I have connected a Windows queue to an HP LaserJet 4000 printer's JetDirect card and shared that printer on the network.

To connect to a Windows printer from your Fedora system, go to System | Administration | Printing and, from the Printer Configuration window, choose the New button. This starts a wizard that walks you through the printer creation process as seen in Figure F.

Figure F

Click the New button to start the printer configuration wizard.

Your first task is to provide Fedora with a name and optional description for this new queue. I've used the name LJ4000N-WIN to indicate that this printer is connected to a Windows server, as seen in Figure G.

Figure G

Give your printer a descriptive name and comment.

After you provide a name for your new printer queue, Fedora pops up the Queue Type window on which you specify the kind of printer to which you are connecting. In this case, Fedora isn't looking for a printer model, but is, rather, looking for the connection type. I've chosen the Networked Windows (SMB) option as shown in Figure H. After you select this option, click the Specify button.

Figure H

Choose the queue type for your new printer.

The Specify button brings up an Authentication dialog window on which you specify all of the information Fedora needs to connect to the Windows-hosted print queue, including the server name, printer's share name, and a username and password for a user that has rights to the printer. This occurs on Figure I.

Figure I

Provide the queue details so that Fedora knows how to connect to this printer.

Once Fedora finds the printer, the Queue Type window is updated with the details as seen in Figure J.

Figure J

The Queue Type window now reflects the queue details from the Windows server.

The next screen of the wizard provides a place for you to specify the kind of printer you are connecting to. Click the button labeled Generic (Click To Select Manufacturer) in order to see the screen shown in Figure K on which you should select the make and model of the printer you're using.

Figure K

Choose your printer's manufacturer and model.

Fedora will ask you if you want to print a test page. I recommend that you do this to make sure everything is working as you expect.

Finally, Fedora brings up the main print queue window with the new queue highlighted as seen in Figure L.

Figure L

The new print queue is created and functioning.

Serve files from Fedora for Windows users

If you want to go full circle and allow Windows users to access your Fedora system and grab files, you'll need to work a little with Samba. I'm going to configure Samba on my Linux machine to authenticate users locally--again, I'm assuming that Windows is your primary operating system. In a future article, I will explore the concept of joining your Fedora server to a Windows domain and authenticating Linux users against Active Directory.

Fedora Core 5 includes Samba 3 (Samba 3.0.21b-2, to be exact), which is installed if you chose Windows File Server as an option during installation of your system. If you didn't install this option during system installation, go to Applications | Add/Remove Software and, under the Servers option, choose Windows File Server. This will install both Samba and a GUI front-end Samba configuration utility.

Once you have Samba installed, go to System | Administration | Server Settings | Samba. You'll get the screen shown in Figure M.

Figure M

Fedora's Samba configuration tools are pretty good.

This starts the Samba Server Configuration tool as seen in Figure N.

Figure N

The Samba Server Configuration tool.

From the configuration tool, go to Preferences | Server Settings. On the Basic tab, Figure O, provide the tool with the name of your Samba workgroup and provide a short description. This workgroup name should not match the name of any of your existing workgroups or domains.

Figure O

The Basic tab is, well, basic!

Now, go to the Security tab.

You have a few choices when it comes to authenticating users that connect to your Fedora-based Samba server. I'm using the Domain option, which passes authentication requests off to a Windows domain controller for handling. You could choose one of these options if you like:

  • ADS - The Samba system acts as a domain member in an Active Directory domain. This option requires the use of Kerberos on your Samba server.
  • Domain - The Samba system relies on an NT PDC or BCD for authentication.
  • Server - Authentication requests are passed off to another Samba server for handling.
  • Share - Users are prompted for a user name and password only when they try to connect to a specific shared folder.
  • User - Samba users must provide a special Samba user name and password.

For my article, I'm choosing the User option and will manually add Samba users that can access the Fedora-hosted resources that I specify.

Click the OK button when you're done.

Figure P

Provide details about how you want to authenticate users.

Now, go to Preferences | Samba Users. On the Samba Users screen, click the Add User button. On the resulting Create New Samba User screen, choose the name of a Fedora system user to whom you would like to grant rights to log in from a Samba system. Bear in mind that users you create in this way need their own local system accounts on the Fedora system. Note, in Figure Q below, the username slowe is specified next to the Unix Username heading. When you're creating a new user, the username would normally show up as a button that you press to get a drop down list of all of your Linux users. Unfortunately, my Fedora installation was mangling the display of the username on this button, so you don't see the actual button in the screenshot.

Figure Q

Provide the necessary details to create a new user.

Note: If you need to learn how to create local users on your system in order to use them with Samba, refer to the third part in this series, Performing Common Administrative Tasks.

Optionally, you can also provide a Windows Username for the user. This is useful if you, for example, use the naming convention first.last on your Windows domain, but you just want to use firstinitial+lastname on your Fedora system. The Windows Username will be mapped to the specified Unix user name when that user logs in. If you want someone to just use the Unix username, enter the Unix username into the Windows field. You cannot leave this field blank.

Finally, provide a Samba password for the user. This does not have to match their local system password or their Windows password.

Once you're done setting preferences and creating users, you should be back at the main Samba Server Configuration window shown in Figure R. On this screen click the Add Share button to open the Create Samba Share box.

In the Create Samba Share dialog window are two tabs: Basic and Access.

On the Basic tab, tell Samba what directory you're like to share, provide a share name that will be advertised and, optionally, give the share a description. You can also decide whether or not this share should be advertised by toggling the Visible option and whether users should be able to modify the contents of this share by toggling the Writable option.

Figure R

Provide details for your new Samba share.

Using the Access tab, you can decide which Samba users should be able to see this new share. Use the Allow Access To Everyone option to allow all Samba users to see the share. When you're done, click the OK button. Note, if a user does not have local access rights to a folder, that Samba user will be able to see that the shared folder exists, but will not be able to access its contents. This is in Figure S.

Figure S

Who gets to see this resource?

When you're done creating the share, it shows up on the Samba Server Configuration window, as you can see in Figure T.

Figure T

I have four sample shares on this server.

Now, from a Windows system, browse to this server using either UNC (\\systemname), or Network Neighborhood. If all goes as planned, you should be greeted with a regular Windows authentication dialog box and then be presented with a list of the shares that were assigned to the user account you used to log into the Fedora system. You'll see this screen on Figure U.

Figure U

I used the slowe (or cheesesteak) user to log in to the Samba system.

That's it!

This level of Fedora/Windows integration, where each system remains independent of one another, lends itself well to sharing files and printers, but can become difficult to maintain as the system grows.