Chemistry Lab University of Washington Computer Science & Engineering
 Introduction to Samba - revised December 2004 - Warren Jessop
  CSE Support    Printer Friendly Version (PDF)   CSE Home    About Us    Search    Contact Info 


What is Samba

Samba is a UNIX tool that enables you to access UNIX files from a PC running Windows 2000/XP. It runs on almost every CSE Lab-managed UNIX host.

Samba also allows ftp-like access to PC fileservers from UNIX hosts.

Accessing Files on CSE Lab UNIX Servers from a Windows PC

A Microsoft Distributed file system (Dfs) server called ntdfs provides "one stop shopping" for most Windows and UNIX shares you need to access. On most systems all of these files are found under the O: drive, as described in Microsoft Dfs.

Accessing your UNIX Home Directory from a PC

To access your UNIX home directory from a PC running Windows 2000/XP you must first know which home directory you want to access. Some people have only one, e.g. on the instructional Linux systems, normally called `/homes/iws/username'. Research users may have several: a "main" research home directory called `/homes/gws/username' on one of the lab managed hosts (e.g. barb), and perhaps a different one when logging into project machines such as the graphics (grail) hosts.

Let's assume your user name is "jouser" and you want to access your "gws" home directory.

You can use a Windows "UNC"(1) name and access it as `\\ntdfs\cs\unix\homes\gws\jouser'.

Or, you can "map" it to a drive letter. To do this choose the `map network drive' button on the menu bar of one of the PC file manager or explorer tools, or use the net command in an MSDOS window. In the example above, jouser would map her home directory using the UNC path given above, e.g. using the net command:(2)

 
net use H: \\ntdfs\cs\unix\homes\gws\jouser

Or, you can use the default mapping of `\\ntdfs\cs' to `O:' (or map `\\ntdfs\cs' to `O:') and access your home directory as `O:\unix\homes\gws\jouser'.

Important notes:

Accessing PC Shared Directories from UNIX using smbclient

WARNING: smbclient Is a Crude Kludge

Smbclient is an extremely crude tool. Here is how smbclient is broken and will frustrate you:

Using smbclient

Smbclient(5), can be used for ftp-like or tar-like access to PC shares. For example, to access the \\ifilesrv2\students1 share in the CSEPCLAB domain, enter
 
smbclient '\\ifilesrv2\students1' -W csepclab
To see what services are offered by ifilesrv1, enter
 
smbclient -L ifilesrv1 -W csepclab
For more information, see the smbclient man page.

Using csepclab-smbclient to rename or reduce your CSEPCLAB Windows profile

There's a special script, /cse/lab/bin/csepclab-smbclient, that will connect automatically to your instructional (CSEPCLAB) Windows home directory share from your instructional Linux account on one of the "attu" servers. There are no parameters to this script; you do not have to know the exact server and share that contains your Windows home directory.

Important: you should not be logged into your Windows account when you do this.

When you run the script you will be prompted for your CSEPCLAB password (NOT your UNIX password!). Once you enter that password, you will need to use the smbclient `cd' command to get into your Windows home directory and profile. Once there, other commands allow you to delete or rename files; refer to the smbclient man page for details.

To completely get rid of your current (possibly corrupted) profile, rename the profile folder.

Here is an example of moving a possibly buggy profile out of the way by renaming it:
 
attu2% /cse/lab/bin/csepclab-smbclient
Password: 
Domain=[CSEPCLAB] OS=[Windows Server 2003 3790] Server=[Windows Server 2003 5.2]
smb: \> cd jouser
smb: \jouser\> ls
  .                                   D        0  Mon Apr 26 15:23:54 2004
  ..                                  D        0  Mon Apr 26 15:23:54 2004
  profile                             D        0  Tue Apr 27 16:37:57 2004
  WINDOWS                             D        0  Mon Apr 26 15:23:54 2004

                64000 blocks of size 8192. 63875 blocks available
smb: \jouser\> rename profile profile.old
smb: \jouser\> cd profile.old
smb: \jouser\profile.old\> ls
  .                                   D        0  Tue Apr 27 16:37:57 2004
  ..                                  D        0  Tue Apr 27 16:37:57 2004
  Application Data                  DHR        0  Mon Apr 26 15:24:08 2004
  Cookies                            DS        0  Tue Dec 23 14:08:26 2003
  Desktop                             D        0  Tue Dec 23 05:59:47 2003
  Favorites                          DR        0  Tue Apr 27 14:45:33 2004
  My Documents                       DR        0  Mon Apr 26 15:24:11 2004
  NetHood                            DH        0  Tue Dec 23 05:59:47 2003
  NTUSER.DAT                          H   786432  Tue Apr 27 16:37:57 2004
  ntuser.dat.LOG                      H     1024  Tue Apr 27 16:37:57 2004
  ntuser.ini                          H      352  Tue Apr 27 16:37:57 2004
  ntuser.pol                        HSR     1698  Tue Apr 27 14:45:33 2004
  PrintHood                          DH        0  Tue Dec 23 05:59:47 2003
  Recent                            DHR        0  Mon Apr 26 15:24:11 2004
  SendTo                            DHR        0  Mon Apr 26 15:24:08 2004
  Start Menu                         DR        0  Tue Dec 23 05:59:47 2003
  Sti_Trace.log                                0  Tue Dec 23 06:03:29 2003
  Templates                          DH        0  Tue Dec 23 05:59:47 2003

                64000 blocks of size 8192. 63875 blocks available
smb: \jouser\profile.old\> q
attu2% 

Footnotes

(1)

One definition of "UNC (Universal Naming Convention) name" (from the Windows 2000 on-line Glossary) reads as follows: "A full Windows 2000 name of a resource on a network. It conforms to the \\servername\sharename syntax, where servername is the server's name and sharename is the name of the shared resource. UNC names of directories or files can also include the directory path under the share name with the following syntax: \\servername\sharename\directory\filename."

(2)

See the net command on-line help for available options and more information.

(3)

This does not necessarily give you login privileges to the remote UNIX host, as you could have a "nologin" entry that only allows remote access of files.

(4)

You will be be prompted if you specify a different username in the `Connect as:' box (or the `/USER:' parameter in the net command), or if the UNIX host's Samba configuration has not yet been changed. If the latter please send mail to support@cs.

(5)

Path names may differ; if not in the regular path, try /usr/local/samba/bin/smbclient



This document was generated on December, 10 2005 using texi2html