Live Chat!

access windows through samba using smbclient

1 votos Vota!!

October 10th, 2006 mysurface Posted in Admin, smbclient | Hits: 17704 |

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 \\192.168.1.1\D$

I want to access to windows machine with IP 192.168.1.1, 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 \\\\192.168.1.1\\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 \\\\192.168.1.1\\D -U mysurface

You can list the shared service by doing this:

smbclient -L 192.168.1.1

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 >

Comment:

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.

5 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}

    Response:

    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
    password

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

Leave a Reply

Security Code: