access windows through samba using smbclient

October 10th, 2006 mysurface Posted in Admin, smbclient | Hits: 89101 | 13 Comments »

I always facing problem with smbclient, couldn’t make it works with IP address, until today I figure it out. By reading smbclient manual, it should work as bellow

smbclient \\\D$

I want to access to windows machine with IP, share directory D. But the command above doesn’t work. What’s wrong with the command line? You need to specified escape for backslash ( \ ). The command line show at bellow will works.

smbclient \\\\\\D

It will ask you for password, default windows xp, you can access without password, just press enter. When if you need username and password?

smbclient \\\\\\D -U mysurface

You can list the shared service by doing this:

smbclient -L

It will list all the shared directory of specified machine.

Once you see the line bellow, you are already in the smb mode, you can get, put, cd etc just like ftp. To check what command is available, you can type “?”

smb >


I feel smbclient not efficient compare to sftp, sftp have great command such as lpwd, lls and lcd which is really efficient, where smbclient only have lcd. But for sftp, you need to have ssh access, it doesn’t work for accessing windows machine. Alternatively, you can access smb service through nautilus too.

13 Responses to “access windows through samba using smbclient”

  1. Hi ,

    I have to access all windows network systems in Linux system i can able to view all networking systems in linux system but when accessing time i got message there is no items fount.

  2. Use forward slashes.

  3. I was able to get this to work with XP Pro PCs with the following command layout:

    smbclient \\\\\\\\machine_name\\\\C$ -U machine_name\\\\Administrator {password}


    Domain=[DOMAIN_NAME] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
    smb: \\>


    The machine_name is actually the NETBIOS name of the computer. Because my PCs are part of a a domain I had to use the designation of Administrator of the PC (aka Administrator (this computer) )

  4. No — the posting above added some backslashes in there..

    smbclient [4 backslashes]
    machine_name [ 2 backslashes ] C$
    -U machine_name [ 2 backslashes] Administrator

  5. Any idea how to test if a remote file exists on the remote Windows share short of using the DIR command?

  6. I don’t understand what is last opinion, how smbclient works trough command line?

  7. Hi. I like your website but i can tell it probably isn’t getting much traffic? If you want to help imrpove that check this website out, he has a short video that i really suggest you watch. Commission Crusher P.S this isn’t my website and i’m not spamming your blog, i don’t care if you delete this comment. I am only trying to help you improve your site.

  8. >> sftp have great command such as lpwd, lls and lcd which is really efficient, where smbclient only have lcd

    actually u could use !pwd and !ls for lpwd and lls respectiveliy (the dame for ftp

  9. I had been wondering if your web hosting is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords.

  10. Have you ever noticed that while sunglasses help you see things clearly outside during the day, when you take them off inside, it is difficult to see at first? Well, with Eagle Eyes sunglasses, you won??have this problem. Because these sunglasses are so comfortable on your eyes, even when you enter a darkened room, you don??have to wait for your eyes to adjust to the light. You can have prescription lenses in the Eagle Eyes sun glasses or you can buy clip on sunglasses that fit over your regular glasses. Now how much more convenient can you have it? fake oakleys wholesale

  11. Great post. I am going through a few of these issues as well.

  12. It’s going to be end of mine day, except before ending I am reading this fantastic piece of writing to improve my knowledge.

  13. UPDATE: good serial at this link ,,
    Here are working key —->
    That did not work out . Here are some good keys

Leave a Reply