|
CSE Support |
Printer Friendly Version (PDF) |
CSE Home |
About Us |
Search |
Contact Info |
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.
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.
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:
www,
needs to see an entry for you in its passwd file. (3) Actually www is not a good example, since all faculty,
staff, and grads have passwd entries on the web server. However, you
should be aware of this if someday you are asked to look at something
on, say, one of the Grail laboratory's research servers on which you do
not have an account.
Smbclient is an extremely crude tool. Here is how smbclient is broken and will frustrate you:
% smbclient //ntdfs/cs
Password:
Domain=[CSERESEARCH] OS=[Windows Server 2003 3790] Server=[Windows Server 2003 5.2]
smb: \> ls
. D 0 Thu Oct 16 16:17:54 2003
.. D 0 Thu Oct 16 16:17:54 2003
bu DH 0 Sat Oct 18 10:06:08 2003
cse D 0 Thu Oct 28 10:25:56 2004
nt D 0 Wed Feb 25 15:28:09 2004
sources D 0 Wed Sep 15 12:54:29 2004
unix D 0 Thu Oct 16 17:04:57 2003
34522 blocks of size 1048576. 29260 blocks available
smb: \> cd cse
smb: \cse\> ls
. D 0 Thu Oct 28 10:25:56 2004
.. D 0 Thu Oct 28 10:25:56 2004
courses D 0 Thu Oct 16 16:16:55 2003
distiller D 0 Thu Oct 16 16:16:56 2003
ftp D 0 Thu Apr 22 14:22:18 2004
groups D 0 Thu Oct 16 16:16:56 2003
lab D 0 Thu Oct 16 16:16:56 2003
labrec D 0 Thu Oct 16 16:16:56 2003
mailing-lists D 0 Thu Oct 16 16:16:57 2003
office D 0 Thu Oct 16 16:16:57 2003
student-affairs D 0 Thu Oct 16 16:16:57 2003
ugrad-org D 0 Sat Oct 2 12:25:46 2004
www D 0 Thu Oct 28 10:25:56 2004
www2 D 0 Thu Oct 16 16:16:58 2003
34522 blocks of size 1048576. 29260 blocks available
smb: \cse\> cd www
smb: \cse\www\> ls
NT_STATUS_PATH_NOT_COVERED listing \cse\www\\*
34522 blocks of size 1048576. 29260 blocks available
smb: \cse\www\> q
|
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 |
smbclient -L ifilesrv1 -W csepclab |
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%
|
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."
See the net command on-line help for available
options and more information.
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.
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.
Path names may differ; if not in
the regular path, try /usr/local/samba/bin/smbclient