Let s Get Practical

Let's Get Practical

Now I'll describe a task that would have been more difficult than it needs to be, if not for Samba. The example may seem trivial (or perhaps it just is ), but it's a real-world application.

My employer has a heterogeneous network environment: Unix and IBM for the big machines, and Windows NT for the desktops and file serving. One day, while browsing one of my favorite news sites (over the lunch hour , of course), I found an interesting link and bookmarked it. When I got home, I wanted to revisit the site, but I had problems remembering the path of links that I took. So my problem was: How do I get to the bookmarks on my desktop machine at work?

If I were using a Windows machine at home, I would use the RAS connection plus SecureID provided for work-at-home employees and map a drive to my desktop to pick up the files I needed. There was a problem with that, though; I don't have a Windows system at home, just Linux. As a consequence, I had never signed up for RAS or obtained a SecureID token. My usual way in from home is through SSH to our Unix servers. But never fear, Samba is here! Here is a transcript of my session (the IP addresses are blanked out):

$ ssh -l pxcurtis devbox.mycompany.com
Last login: Wed Aug 2 11:31:03 2000
No mail.
bash-2.01$ smbclient //W-IS-PXC/C$ -U PXCURTIS -W MYCOMPANY
added interface ip=172.17.*.* bcast=172.17.255.255 nmask=255.255.0.0
Password:
Domain=[MYCOMPANY] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
smb: > cd "Program Files/Netscape/Communicator/Users/pxcurtis"
smb: > get bookmarks.htm
getting file bookmarks.htm of size 4021 as bookmarks.htm (47.4793 kb/s)
smb: > exit
 
[In another terminal window on my home machine]
$ scp pxcurtis@devbox.mycompany.com:bookmarks.htm bookmarks.htm

The first step was to SSH in to establish access to the company network. Although it wasn't too important for this application, an added benefit of using SSH was the encryption of all information traversing the public parts of the Internet. Once I got to the shell prompt on our Unix server, I ran the smbclient program to connect to a share on my desktop machine, specifically , the hidden "administrative" share set up by desktop support as C$. I made sure to specify the user and domain as well, using the command line options. Then I entered my Windows account password and used the SMB client program to change to the correct directory and retrieve my Netscape bookmarks file to the Unix server. Finally, I used scp to copy the file to my home machine, all in under 60 seconds.

Of course, this wouldn't have helped if I had shut my desktop machine off at the end of the day, like everyone else.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net