How do I access a password protected share from nautilus?

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?


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