13

I am trying to copy a (.html) file from a Windows XP Professional shared folder onto a server running Ubuntu Linux 10.04 LTS.

As it's a shared folder the usual 'wget' doesn't seem to work. I suspect I'm using the wrong address style completely.

I have tried:

  1. http://192.168.1.66/SharedFolder/Data.html
  2. //192.168.1.66/SharedFolder/Data.html
  3. smb://192.168.1.66/SharedFolder/Data.html
  4. //192.168.1.66/SharedFolder/Data.html
  5. 192.168.1.66/SharedFolder/Data.html

I wondered if this is even possible and if it is, could someone give me some pointers?

I've successfully pinged the Windows box from Ubuntu:

# ping 192.168.1.66
PING 192.168.1.66 (192.168.1.66) 56(84) bytes of data.
64 bytes from 192.168.1.66: icmp_seq=1 ttl=128 time=0.412 ms
64 bytes from 192.168.1.66: icmp_seq=1 ttl=128 time=0.557 ms (DUP!)
64 bytes from 192.168.1.66: icmp_seq=2 ttl=128 time=0.243 ms
64 bytes from 192.168.1.66: icmp_seq=3 ttl=128 time=0.251 ms
64 bytes from 192.168.1.66: icmp_seq=4 ttl=128 time=0.266 ms

and I can access the Windows share from every other computer on the network, however, they are all running Windows XP Professional aswell. I'm not sure if it's a problem between Ubuntu and Windows shares in general or just that my URL style is wrong.

1 Answer 1

20

If you want to use the GUI, try clicking Places -> Connect to Server.... For Service Type choose Windows share, and fill out the fields like so:

Server: 192.168.1.66
Share: SharedFolder

Then download your file from the window. If you want to use a command-line interface, smbclient uses a FTP-like interface (get, put, etc.):

~$ smbclient //192.168.1.66/SharedFolder
Password:
smb: \> get Data.html

Alternatively, you could mount the share as a CIFS filesystem: (First, ensure that cifs-utils is installed)

~$ sudo mount -t cifs //192.168.1.66/SharedFolder /mnt

If your share requires authentication, provide the username to smbclient with the -U option, or to mount with -o user=username

2
  • 1
    The smbclient option worked a treat, is there anyway of scripting this? I need to get the file every minute or so. Can I just use a bash script with the smbclient command, then my root password followed by get Data.html? Oh, and exit to come out of the smbclient?
    – dannymcc
    Apr 5, 2012 at 21:15
  • 6
    Storing your password anywhere is a bad idea. However, if you wanted to, you could do smbclient -A authfile //IP/Share -c 'get Data.html' and have your credentials stored in a file with root-only permissions (chmod 600). See the manpage for details on -A Apr 5, 2012 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .