Convert Microsoft to LINUX: Linux Administrator FAQ


This FAQ is intended for advanced Linux users. If you do not completely understand it, I am available for consultation.

How can I print from a Microsoft Windows machine to the printer attached to the Linux server?

First of all, I assume you have followed the instructions at FAQ   for installing the printer on Linux. The act of doing this insures that the CUPS (Common UNIX Printing System) is installed. This is used when you print a file from your Linux host for formatting. There is one additional piece of software you need to print from Microsoft Windows machines called Samba. This allows the Microsoft Windows machines to browse to your printer on the Linux box and make a connection. Since Samba can serve up to 100 clients at a time it is called a "Samba Server". Samba should be installed by default, if it is not go to YAST and install it. Also while in YAST click on Network Services | Samba | Enable Samba Server. Note the default name for your Microsoft Windows Workgroup TUX-NET. If that is not the name of your Workgroup, edit it to be the one you want. Now edit using vi or your favorite editor, the file "/etc/samba/smb.conf" . Note, always make a backup copy of any file you edit first (i.e. cp smb.conf smb_orig.conf ). The minimum entries you need are something like:

[global]
load printers = yes
printing = cups
printcap name = cups
[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root, @ntadmins
Note: your paths may be slightly different and you may choose to say browseable = no and guest ok = no for added security.

If you do not want to type the file in, here it is:   smb_simple

There is one last step. Microsoft machines like to use their own print drivers to do the formatting. So they do not want CUPS doing formatting. In order to allow this we have to enable raw printing . That is the file will be sent and no further processing will happen on it other than directing the octet-stream (data) to the Linux printer. We must edit two files to do this:
/etc/cups/mime.types to uncomment (remove # sign) the line near the end of the file that has
#application/octet-stream
to read
application/octet-stream

Likewise edit /etc/cups/mime.convs to uncomment the line that begins with #application/octet-stream ....

How can I print from a MAC OS X machine to the printer attached to the Linux server?

This is incredibly easy. Rember MAC OS X is basically a "UNIX/LINUX" clone so lp the UNIX line printer requester is built in. This is also known as IPP or TCP printing. So now you have the client side all you need is the server side. Go to YAST and click on Network Services | Network Services |inetd | Enable printer stream tcp service. Note, you must highlight it and click on it to toggle it on. This service is also known as lpd or Line Printer Daemon. Now go back to your MAC and add an IPP printer. Pick the IP address of your Linux host by name or spelled out by IP address. Say ok and you are done.

How can I share files from the Linux Server to the MAC OS X or Microsoft Windows machines?

On both the MAC OS X and Microsoft Windows machines you can use Samba Server. Follow the instructions as you did for enabling printing via Samba and make sure you additionally check file sharing . You may want to edit the file sharing to choose who can log in and which directories they can see. Note, the default is for everybody to see everything!

A more secure alternative is NFS Server. You go to YAST | Network Services | NFS Server to enable this. Be extra careful about your directories you export to be seen on your network. Here I would also not go with the defaults.

You will need an NFS client for Microsoft Windows. There are ones out there made by WRQ INC. and Hummingbird INC. The MAC OS X has one built in. Follow these instructions to enable it using the Netinfo utility.

Is it true I can also use Samba Server as a primary domain controller and back up controller
for a Microsoft Windows Network?

Believe it or not, yes it acutally is . You would actually need 3 Linux boxes. One for Samba file and print sharing , one as a primary domain controller and one as a backup domain controller. Here is a sample Samba Primary Domain Controller file which I tested:   Samba PDC It assumes the following users: user1, user2, and victor who store their profile in a directory called /home/user1 home/user2 home/victor. Note, you will have to customize this some for your installation! However it should get you 98 percent of the way. Lastly, here is a sample logon.bat file which also needs to be customized to go with it. Just to prove that everything works you can make it even simpler. Let this be the one line in your logon.bat file:
net use H:\\192.168.0.9\%username%
Note, I hardcoded the address here. Instead you can use an entry from the host name table. On your MAC or Microsoft Windows machine you would then want a user called user1. Lastly you want to synchronize your Windows password for Samba to your UNIX user password. Luckily there is a nice utility built into Mandriva to do this. If you have not already install webmin . That is type urpmi webmin and feed it the CD. Now go into Konqueror or whatever web browser you have and type:
https://localhost:10000
This will run the webmin program. You can now click on Servers after logging in using root and your root password. Now click on Samba Windows File Sharing . Click on Convert Unix users to Samba users . Now you will have Samba accounts for all the users in Windows and the password will be synchronized. To check that everything is working, go to a Terminal Konsole prompt. Log in as root by typing su then your password (linux01). Here type:
smbstatus
You should see something like: smb_status.txt

If you would rather synchonize the Samba and normal users by hand , this can be done very simply. Type in the following command:
smbpasswd -a victor
This adds the user victor, who you have already created an account for, to the Samba Database.

Another useful tool for configuring Samba is swat if webmin is not available. Here is how to install it with an Ubuntu/Debian type distribution. Type the following commands:
apt-get install samba
apt-get install apache2
apt-get install xinetd
apt-get install swat
Edit the file /etc/inetd.conf and uncomment the # sign so the swat service will run. It should look something like this .
You now need to create the swat service file. i.e.
vi /etc/xinetd.d/swat
Here is a sample . Next type:
sudo dpkg-reconfigure xinetd
to restart Samba with the new configuration. To test that swat is there type netstat -lt and you should see the swat service. Lastly type this at your favorite browser:
http://localhost:901
and you are ready to go!

If you just want simple samba file sharing, you can do it with the built in GUI interface in Kubuntu by clicking on
the main menu | system settings | sharing (under internet and networking section) .
Here you can then click on file sharing and add in your shares. I added in my entire mounted FAT32 Windows XP Partition, which was on /mnt/data . I called the share WINPART. Here is my sample smb.conf file showing this. Note, this is identical to the way you do it on the MAC OS X.

Is it true I can set up my own Mail Server with Linux?

In principal, this is extremely simple. It requires just two pieces which can live on the same host: SMTP (Simple Mail Transfer Protocol) Server for outgoing mail and a Pop3 Server for incoming mail. To enable this go to YAST | Network Services | inetd | and enable both of these Servers . You may have to install the software if it is not there. You will be prompted for the appropiate CD's. Don't forget to toggle the Servers on. Note, it defaults to just being on your localhost, that is your Linux box. To test it go into KMail | Settings | Configure Mail and use the chart below:

UsernamePasswordExplanation
user1@localhost linuxisfun This is your normal full email login.


POP Mail ServerSMTP Mail ServerExplanation
linux.site localhost incoming and outgoing mail servers


Note, this is identical to what was explained earlier in the FAQ.   Notice how some "dummy" names and IP addresses were created automatically for you to be your SMTP and Pop3 Servers. Localhost by the way is the loopback 127.0.0.1 and linux.site maps to 127.0.0.2 . A treatise could be written on mail, but now you know enough to set it up.

It looks like you have covered everything except the DHCP Server, DNS Server
(Domain Name Server) , HTTP Server (Web Server) and the FTP Server.
Do I need to enable these on my Linux box too?

You can enable these on your Linux box similarly by going to YAST | Network Services for all of the servers except the FTP Server which is located at YAST | Network Services | inetd. Usually, you will get the DNS and DHCP Server automatically through your DSL/Cablenet provider. So they are not necessary. The HTTP Server and FTP Server are available for $10/month on a commercial Linux Box, therfore I recommend using that. I mentioned this in my Services for Microsoft Folks page.