Accessing a windows shared folder from Linux?

152

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

Share:
152

Related videos on Youtube

Chinwobble
Author by

Chinwobble

Updated on September 18, 2022

Comments

  • Chinwobble
    Chinwobble over 1 year

    I have the following code. This creates a dialog box just fine.

    import tkinter as tk
    import tkinter.ttk as ttk
    
    class Window(ttk.Frame):
    
        def __init__(self, master=None):
            super().__init__(master, padding=2) # Creates self.master
            helloLabel = ttk.Label(self, text="Hello Tkinter!")
            quitButton = ttk.Button(self, text="Quit", command=self.quit)
            helloLabel.pack()
            quitButton.pack()
            self.pack()
            #self.create_widgets()
            #self.create_layout()
    
    
        # def create_widgets(self):
            # pass
    
    
        # def create_layout(self):
            # pass
    
    application = tk.Tk()
    application.title("Window")
    Window(application)
    application.mainloop()
    

    How come when I uncomment the following two lines in the above code the code breaks?

    def create_widgets(self):
        pass
    

    I'm using python 3.4 32 bit on Windows 7 64-bit.

  • dannymcc
    dannymcc about 12 years
    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?
  • bonsaiviking
    bonsaiviking about 12 years
    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