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
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.
It will ask you for password, default windows xp, you can access without password, just press enter. When if you need username and password?
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 “?”
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.