Administration
  Home arrow Administration arrow Page 3 - Dancing The Samba (part 2)
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ADMINISTRATION

Dancing The Samba (part 2)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 8
    2002-10-22


    Table of Contents:
  • Dancing The Samba (part 2)
  • What's In A Name?
  • Making Conversation
  • Mounting Up
  • Backing Up
  • Keeping It Simple
  • Working The Web

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Dancing The Samba (part 2) - Making Conversation
    ( Page 3 of 7 )

    You're already familiar with the "smbclient" utility - I used it when first configuring and testing Samba. But "smbclient" can do a lot more than just verify that your Samba installation is working as advertised - it's actually a full-featured FTP-like SMB client that can be used to perform file transfer and manipulation operations with an SMB server.

    You can start up "smbclient" by providing it with a host name and share name to access.
    $ /usr/local/samba/bin/smbclient //medusa/music
    Password: 
    smb: \>
    Once you're connected to that share, you can use standard commands to transfer files, read file information and perform other common file operations. Consider the following sample session, which should demonstrate most of the common operations:
    smb: \> cd
    Current directory is \
    smb: \> mkdir temp
    smb: \> cd temp
    smb: \temp\> dir
      .                                   D        0  Tue Oct  8 17:09:18
    2002
      ..                                  D        0  Tue Oct  8 17:09:18
    2002
    
                    63882 blocks of size 32768. 1681 blocks available
    smb: \temp\> put menu.php 
    putting file menu.php as \temp\menu.php (53.0271 kb/s) (average 53.0273
    kb/s)
    smb: \temp\>
    smb: \> mput *.zip
    Put file www.zip? y
    smb: \> q
    $
    You can obtain help by typing
    smb: \> help
    ls             dir            du             lcd            cd
    
    pwd            get            mget           put            mput
    
    rename         more           mask           del            open
    
    rm             mkdir          md             rmdir          rd
    
    prompt         recurse        translate      lowercase      print
    
    printmode      queue          cancel         quit           q
    
    exit           newer          archive        tar            blocksize
    
    tarmode        setmode        help           ?              history
    
    !              
    at the command prompt, or a one-line description of each command by typing "help" followed by the command name.
    smb: \> help mkdir
    HELP mkdir:
            <directory> make a directory
    In case you're having difficulty connecting to shares, you can have "smbclient" generate debug data by adding the "-d" command-line option, followed by a number from 0 to 10; the higher the number, the greater the level of detail provided. Consider the following example, which demonstrates:
    $ /usr/local/samba/bin/smbclient //medusa/music -d 5
    Client started (version 2.0.6).
    resolve_lmhosts: Attempting lmhosts lookup for name medusa<0x20>
    getlmhostsent: lmhost entry: 127.0.0.1 localhost 
    resolve_hosts: Attempting host lookup for name medusa<0x20>
    resolve_wins: Attempting wins lookup for name medusa<0x20>
    bind succeeded on port 0
    nmb packet from 127.0.0.1(137) header: id=15735 opcode=Query(0)
    response=No
        header: flags: bcast=No rec_avail=No rec_des=Yes trunc=No auth=No
        header: rcode=0 qdcount=1 ancount=0 nscount=0 arcount=0
        question: q_name=MEDUSA<20> q_type=32 q_class=1
    Sending a packet of len 50 to (127.0.0.1) on port 137
    read_udp_socket: lastip 127.0.0.1 lastport 137 read: 62
    parse_nmb: packet id = 15735
    Received a packet of len 62 from (127.0.0.1) port 137
    nmb packet from 127.0.0.1(137) header: id=15735 opcode=Query(0)
    response=Yes
        header: flags: bcast=No rec_avail=Yes rec_des=Yes trunc=No auth=Yes
        header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0
        answers: nmb_name=MEDUSA<20> rr_type=32 rr_class=1 ttl=496220
        answers   0 char ......   hex 0000C0A8008F
    Got a positive name query response from 127.0.0.1 ( 192.168.0.143 )
    Connecting to 192.168.0.143 at port 139
    write_socket(3,76)
    write_socket(3,76) wrote 76
    Sent session request
    got smb length of 0
    size=0
    ... and so on (snip!) ...
    One of the cooler (and also more annoying) things you can do with "smbclient" involves using it to send text messages across a network to Windows workstations. These messages appear on the target Windows workstation via the WinPopup utility. Consider the following example, which demonstrates:
    $ /usr/local/samba/bin/smbclient -M medusa
    Connected. Type your message, ending it with a Control-D
    system is going down!
    sent 25 bytes
    $
    When this message is sent to the Windows workstation named "medusa", it pops up as a dialog box on that machine (note that in order for this to work, WinPopup must be installed on the target system, and must be configured to accept and display messages).



     
     
    >>> More Administration Articles          >>> More By icarus, (c) Melonfire
     

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek