Ubuntu 12.04.1 LTS, kernel 3.2.0-57-generic Windows Server 2008 R2 SP1 x64

Trying to setup a network share from Ubuntu 12.04 to a Windows Server 2008 R2 however no matter what changes are made the share fails to mount due to error(13): permission denied.

Firewall port 445 has been opened between the two servers which enabled me to ping the servers from each other so it's not something on the firewall blocking the connection.

The windows server is not part of a domain so I've tried with and without workgroup option. The windows account isn't disabled, I check often to make sure that I haven't locked it. Trying to use a 16 char password with lower/upper alphanumeric. No special characters.

Windows Advanced Share permissions has Everyone(full/read/write) and the user account(full/read/write) permissions. Windows Folder Security has Everyone(Full/read/write) and the user account (full/read/write). I can access the windows share from my local box using the same username/password as used for the mount commands below. The windows share is located at C:\Share.

Windows Event viewer is reporting it as Unknown user name or bad password with or without the sec=ntlmv2 or sec=ntlm. Any changes to the sec option still provides a error(13). The user account is an administrator on the server and i've typed and retyped and reset the password from something complex to something simple and still not going through. My local box can connect through the windows share no problem with any version of the password set.

The windows network connection is considered a public network. Under Network and Sharing Center the Advanced Sharing Settings->Home/Work and Public - Public Folder sharing have been set to turned On. Password protected sharing-> turned on since I'm trying to use an admin account local to the server.

The /mnt/share directory has been created and has been tested with rw-rw-r--,rwxrwxrwx,rw-rw-rw-,rwxrwxrw- permissions just in case it had something to do on the linux side.

I tried both user= and username= with all of the commands listed below. Also made sure not to use any extra white spaces unless needed. No quotation marks are used anywhere in the commands, I've read some people were doing username='user'

Following received a Error:13(Permission denied)

sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass}
sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},nosuid
sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlm
sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlmssp
sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8
sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8,sec=ntlm

sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445
sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,nosuid
sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlm
sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlmssp
sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8
sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,workgroup=workgroup,file_mode=0777,dir_mode=0777,iocharset=utf8,sec=ntlm

Following received a Error:22(Invalid Argument)

sudo mount.cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},port=445,sec=ntlmv2
sudo mount -t cifs //{ipaddress}/share /mnt/share -o user={user},password={pass},sec=ntlmv2
sudo mount -t cifs //{ipaddress}/share /mnt/share -o sec=ntlmv2,user={user},password={pass},port=445

I also downloaded and tried the outdated SMBFS which also produced a Error:13

Any thoughts?

  • What about if you pass the domain parameter? mount -t cifs //{hostname}/{sharename} /mnt/share -o username={username},password={password},domain={hostname}
    – user34720
    Apr 30, 2014 at 1:33
  • The domain also gave the permissions error. I reset the password again to 'Testpass01' for being quite a bit shorter than all the other passwords used and was able to connect.
    – Kijl
    Apr 30, 2014 at 17:18

3 Answers 3


I am having the same issue. However by adding osec flag seems to be working for me. I cannot create any new file/folder, but can write to the existing files.

//{ip_address}/{sharename}  /mnt/server1  cifs (rw,nodev,uid=0,gid=0,credentials=/home/{user}/.smbcredentials,iocharset=utf8,file_mode=777‌​,dir_mode=777,osec=ntlmv2) 0 0

I have this on the /etc/fstab file.


Was able to resolve the issue by using a shorter password than previously, old password was 16 characters new password is 10. Also, even after mounting with something basic like

sudo mount -t cifs //{ipaddress}/share /mnt/share  -o user={},password={},domain={},port=445

I was unable to write but able to view any changes made on the Windows server. I needed to include


or a combination of permissions to allow a user to write through the SFTP into the Linux folder which is a mount of the windows server folder.


old thread, yes, but I was having the same issues and then I finally realized what could possibly be the issue and it was my username. I had to change my username in the syntax to {Everyone} and it worked like a charm.

  • 1
    {user} is supposed to be replaced with your username Dec 25, 2021 at 11:07

You must log in to answer this question.

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