File Sharing with Microsoft Computers
The Server Messaging Block (SMB) protocol is behind Microsoft networking. Unix typically uses NFS or Network File System. In order to share files with Microsoft computers, two approaches can be used -- either install SMB (Samba) services on the Unix machine or install NFS services on BOTH the Unix AND the Microsoft machines. Using Samba is by far the easier approach.
First be sure your TCPIP is configured correctly. For your small beginner network I recommend NOT using DHCP (that comes later) and using the following address scheme:
  • For each machine use IP address 192.168.0.x where x is a unique number for each computer between 1 and 254 inclusive.
  • For each machine use subnet mask 255.255.255.0.

  • Test the machines by entering the command
    ping [other machine's IP address] (from the MSDOS prompt in 95/98, from a console in Linux, or from a cmd window in NT/2000). If you get a reply, your network cards and cabling are working.
    To see the unix computer from Network NeighborhoodYou need to set the following properties in your /etc/smb.conf file
  • workgroup=[name of Windows workgroup]
  • security=user
  • encrypt passwords=yes
  • smb passwd file=/etc/smbpasswd
  • comment=Samba Server (or whatever you'd like)

  • The computer name will default to whatever you named the computer in the domain, i.e if you named it mylinux.mydomain.com it will appear in the Windows workgroup as Mylinux. The last step you need is to execute the smbpasswd command from Linux to give the Windows username a Samba account on the Unix box (this mimics NT behavior)
    Exactly what files will be seen on the Windows computer? Normally it would be the /home/[username] directory, unless additional shares are defined by linuxconf.
    To see the Windows shares from the linux box you have two approaches
  • Use smbclient //machinename/sharename. You will then be asked for a password for your assumed username (your unix logon). OR You can type
    smbclient //machinename/sharename -U [username] to log on to the Windows machine as that user. Then you can ls to list files and do a get command to transfer an individual file to the Unix directory you're on. Smbclient can be run as any unix user
  • Use smbmount (you must be root). The syntax is (for 2.0.5a -- if your Samba is different your syntax may differ)
    smbmount //machinename/sharename /mountpoint -U [Windows username]. When finished, execute the command umount /mountpoint (when NOT in the directory) to unmount the share

  • The same commands can be used to access another Unix box running Samba