Ubuntu – How to access a password protected share from nautilus

file-sharingnautilussmb

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?

Best Answer

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.