How do I access a password protected share from nautilus?

18,872

Solution 1

The new nautilus in 13.04 (raring) no longer shows a place to enter connection credentials. This makes it really hard to connect if you don't know the URI syntax. You can find help for the SMB URI syntax at Wikipedia.

Basically, use one of these URIs:

smb://[<user>@]<host>[:<port>][/[<path>]][?<param1>=<value1>[;<param2>=<value2>]] or
smb://[<user>@]<workgroup>[:<port>][/] or
smb://[[<domain>;]<username>[:<password>]@]<server>[:<port>][/[<share>[/[<path>]]][?[<param>=<value>[<param2>=<value2>[...]]]]][5]

The user name can contain spaces explicitly and doesn't require encoding. Myself, I used the following:

smb://My User@WINDOWSHOST/Share

You then are prompted for the credentials. I'm not sure if the share name can have a space since my shares don't have them, so I haven't tested it.

Once you access the share, you can right-click on it in the left panel and Bookmark it. This will make it remap when you log off and back in so you don't have to keep using the Connect to Server method all the time.

Solution 2

Based on my nautilus (3.4.2), in unity menu, you choose file, connect to server, then server details (the ip of the shared directory), type (windows share), and then you state share, folder and user details (domain, user, password). My install runs with cifs-utils installed (sudo apt-get install cifs-utils). You can also mount this share during start-up by adding in /etc/fstab:

//192.168.X.Y/shareddirectory /home/user/sharename cifs auto,iocharset=utf8,uid=1000,gid=1000,user=username%password 0 0

Share:
18,872
John Fordyce
Author by

John Fordyce

I have used Ubuntu since 5.10. I recently passed my LPI 101 and LPI 102 exams. I love that on Ubuntu you can do anything. As an African, I find it really strange to hear Ubuntu pronounced by the rest of the world.

Updated on September 18, 2022

Comments

  • John Fordyce
    John Fordyce over 1 year

    I can access the server and non password protected shares by using the following commands: ctrl + l smb://server/share

    I can connect to the share using

    smbclient //server/share -U 

    I can connect using the command line using the following command:

    sudo mount -t cifs //server/share -o username=user,password=password,uid=1000,gid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777

    How do I connect to this share using Nautilus 3.6.3?

    • Chella
      Chella about 11 years
      would have given more information on what you want and what you did so far
  • John Fordyce
    John Fordyce about 11 years
    I know I can mount the directory from /etc/fstab, but that mounts it permanently. I only need to temporarily access a share. It used to be easy to do from Nautilus as their was an option to add a username and password. You can no longer add the username or password. I need to find out how to do this.
  • bob
    bob about 11 years
    if you try to connect to server from nautilus via file menu?
  • John Fordyce
    John Fordyce about 11 years
    The message received is: "Unhandled error message: Failed to mount Windows share"
  • bob
    bob about 11 years
    or alternatively in fstab to use noauto instead of auto
  • John Fordyce
    John Fordyce about 11 years
    Thanks, command line works fine. I'm still looking for a way to do it via the gui.
  • bob
    bob about 11 years
    seeing your update, it should be a permissions problem (0777)
  • guntbert
    guntbert about 11 years
    @bob don't recommend 0777 without further inquiry!
  • Hatoru Hansou
    Hatoru Hansou over 8 years
    Last example worked for me. When I try to connect to a Windows Share (from Ubuntu 14.04 to a PC running Windows) if the connection is refused Nautilus shows the credentials prompt dialog, the problem is when the destination Windows PC allows read only access to guest users. This is annoying because Nautilus connect with read only permissions and you are never given the chance to gain write access. That URL worked. Now I have write access as I can enter the password, thank you. Use "smb://user@host/resource" and Nautilus will show the dialog.
  • inf3rno
    inf3rno about 8 years
    The problem, that data transfer by cifs mount is about 10 times faster than mount with gvfs. By gvfs mount we got the password prompt, by cifs mount we don't. :S Hopefully this will be fixed soon.
  • inf3rno
    inf3rno about 8 years