mount -t cifs fails with permission denied
Clash Royale CLAN TAG#URR8PPP
I have a Windows 10 share for a particular user. Then I have Debian:stretch in a docker container. I try to mount a shared folder like this:
root@b9cda19f784c:~# mount -t cifs -v -o username=dockerfile,password=docker,sec=ntlm //10.0.75.1/hlds /root/somedir
mount: permission denied
I tried to remove sec=ntlm
option, set uid
and gid
in options but didn't succeed. Also I don't see any verbose messages that I'm expecting of -v
flag.
From my Windows 10 host I can mount this folder using a command:
net use p: \10.0.75.1hlds /user:dockeruser
How can I make mount
command output more information to debug? Or what am I missing in my mount
command?
UPDATE
Running a container with --privileged
flag doesn't help:
root@62d77b4c1058:/# mount -v -t cifs -o username=dockerfile,password=docker //10.0.75.1/hlds /root/mnt
mount.cifs kernel mount options: ip=10.0.75.1,unc=\10.0.75.1hlds,user=dockerfile,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
And creating a volume using Docker and mounting it didn't succeed:
PS F:reposhlds-docker> docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0 myvolume
myvolume
PS F:reposhlds-docker> docker run --rm -v myvolume:/root -it --privileged debian:stretch bash
C:Program FilesDockerDockerResourcesbindocker.exe: Error response from daemon: error while mounting volume with options: type='cifs' device='//10.0.75.1/hlds' o='username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0': permission denied.
See 'C:Program FilesDockerDockerResourcesbindocker.exe run --help'.
My Docker Version:
PS F:reposhlds-docker> docker version
Client: Docker Engine - Community
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:34:26 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:41:49 2019
OS/Arch: linux/amd64
Experimental: false
debian mount cifs volume
add a comment |
I have a Windows 10 share for a particular user. Then I have Debian:stretch in a docker container. I try to mount a shared folder like this:
root@b9cda19f784c:~# mount -t cifs -v -o username=dockerfile,password=docker,sec=ntlm //10.0.75.1/hlds /root/somedir
mount: permission denied
I tried to remove sec=ntlm
option, set uid
and gid
in options but didn't succeed. Also I don't see any verbose messages that I'm expecting of -v
flag.
From my Windows 10 host I can mount this folder using a command:
net use p: \10.0.75.1hlds /user:dockeruser
How can I make mount
command output more information to debug? Or what am I missing in my mount
command?
UPDATE
Running a container with --privileged
flag doesn't help:
root@62d77b4c1058:/# mount -v -t cifs -o username=dockerfile,password=docker //10.0.75.1/hlds /root/mnt
mount.cifs kernel mount options: ip=10.0.75.1,unc=\10.0.75.1hlds,user=dockerfile,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
And creating a volume using Docker and mounting it didn't succeed:
PS F:reposhlds-docker> docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0 myvolume
myvolume
PS F:reposhlds-docker> docker run --rm -v myvolume:/root -it --privileged debian:stretch bash
C:Program FilesDockerDockerResourcesbindocker.exe: Error response from daemon: error while mounting volume with options: type='cifs' device='//10.0.75.1/hlds' o='username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0': permission denied.
See 'C:Program FilesDockerDockerResourcesbindocker.exe run --help'.
My Docker Version:
PS F:reposhlds-docker> docker version
Client: Docker Engine - Community
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:34:26 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:41:49 2019
OS/Arch: linux/amd64
Experimental: false
debian mount cifs volume
add a comment |
I have a Windows 10 share for a particular user. Then I have Debian:stretch in a docker container. I try to mount a shared folder like this:
root@b9cda19f784c:~# mount -t cifs -v -o username=dockerfile,password=docker,sec=ntlm //10.0.75.1/hlds /root/somedir
mount: permission denied
I tried to remove sec=ntlm
option, set uid
and gid
in options but didn't succeed. Also I don't see any verbose messages that I'm expecting of -v
flag.
From my Windows 10 host I can mount this folder using a command:
net use p: \10.0.75.1hlds /user:dockeruser
How can I make mount
command output more information to debug? Or what am I missing in my mount
command?
UPDATE
Running a container with --privileged
flag doesn't help:
root@62d77b4c1058:/# mount -v -t cifs -o username=dockerfile,password=docker //10.0.75.1/hlds /root/mnt
mount.cifs kernel mount options: ip=10.0.75.1,unc=\10.0.75.1hlds,user=dockerfile,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
And creating a volume using Docker and mounting it didn't succeed:
PS F:reposhlds-docker> docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0 myvolume
myvolume
PS F:reposhlds-docker> docker run --rm -v myvolume:/root -it --privileged debian:stretch bash
C:Program FilesDockerDockerResourcesbindocker.exe: Error response from daemon: error while mounting volume with options: type='cifs' device='//10.0.75.1/hlds' o='username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0': permission denied.
See 'C:Program FilesDockerDockerResourcesbindocker.exe run --help'.
My Docker Version:
PS F:reposhlds-docker> docker version
Client: Docker Engine - Community
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:34:26 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:41:49 2019
OS/Arch: linux/amd64
Experimental: false
debian mount cifs volume
I have a Windows 10 share for a particular user. Then I have Debian:stretch in a docker container. I try to mount a shared folder like this:
root@b9cda19f784c:~# mount -t cifs -v -o username=dockerfile,password=docker,sec=ntlm //10.0.75.1/hlds /root/somedir
mount: permission denied
I tried to remove sec=ntlm
option, set uid
and gid
in options but didn't succeed. Also I don't see any verbose messages that I'm expecting of -v
flag.
From my Windows 10 host I can mount this folder using a command:
net use p: \10.0.75.1hlds /user:dockeruser
How can I make mount
command output more information to debug? Or what am I missing in my mount
command?
UPDATE
Running a container with --privileged
flag doesn't help:
root@62d77b4c1058:/# mount -v -t cifs -o username=dockerfile,password=docker //10.0.75.1/hlds /root/mnt
mount.cifs kernel mount options: ip=10.0.75.1,unc=\10.0.75.1hlds,user=dockerfile,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
And creating a volume using Docker and mounting it didn't succeed:
PS F:reposhlds-docker> docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0 myvolume
myvolume
PS F:reposhlds-docker> docker run --rm -v myvolume:/root -it --privileged debian:stretch bash
C:Program FilesDockerDockerResourcesbindocker.exe: Error response from daemon: error while mounting volume with options: type='cifs' device='//10.0.75.1/hlds' o='username=dockerfile,password=docker,file_mode=0777,dir_mode=0777,uid=0,gid=0': permission denied.
See 'C:Program FilesDockerDockerResourcesbindocker.exe run --help'.
My Docker Version:
PS F:reposhlds-docker> docker version
Client: Docker Engine - Community
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:34:26 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:41:49 2019
OS/Arch: linux/amd64
Experimental: false
debian mount cifs volume
debian mount cifs volume
edited Feb 26 at 15:24
Roman
asked Feb 25 at 17:48
RomanRoman
12
12
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
So after some trials and tributations I found a solution (but I think it's weird).
You need to do 2 steps:
- Put some dummy file in your dir so it's not empty (either way you get
permission denied
error) - Create docker volume with
noserverino
option (found accidentally)
So in my case it's:
docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockeruser,password=docker,noserverino,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 somevol
And then:
docker run --rm -v somevol:/home/steam/opts -it krow7/hlds:1.0 bash
So you have your dirs owned by an exact user you need and can do all operations with files on a mounted share.
I hope someone will find it useful.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502954%2fmount-t-cifs-fails-with-permission-denied%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
So after some trials and tributations I found a solution (but I think it's weird).
You need to do 2 steps:
- Put some dummy file in your dir so it's not empty (either way you get
permission denied
error) - Create docker volume with
noserverino
option (found accidentally)
So in my case it's:
docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockeruser,password=docker,noserverino,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 somevol
And then:
docker run --rm -v somevol:/home/steam/opts -it krow7/hlds:1.0 bash
So you have your dirs owned by an exact user you need and can do all operations with files on a mounted share.
I hope someone will find it useful.
add a comment |
So after some trials and tributations I found a solution (but I think it's weird).
You need to do 2 steps:
- Put some dummy file in your dir so it's not empty (either way you get
permission denied
error) - Create docker volume with
noserverino
option (found accidentally)
So in my case it's:
docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockeruser,password=docker,noserverino,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 somevol
And then:
docker run --rm -v somevol:/home/steam/opts -it krow7/hlds:1.0 bash
So you have your dirs owned by an exact user you need and can do all operations with files on a mounted share.
I hope someone will find it useful.
add a comment |
So after some trials and tributations I found a solution (but I think it's weird).
You need to do 2 steps:
- Put some dummy file in your dir so it's not empty (either way you get
permission denied
error) - Create docker volume with
noserverino
option (found accidentally)
So in my case it's:
docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockeruser,password=docker,noserverino,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 somevol
And then:
docker run --rm -v somevol:/home/steam/opts -it krow7/hlds:1.0 bash
So you have your dirs owned by an exact user you need and can do all operations with files on a mounted share.
I hope someone will find it useful.
So after some trials and tributations I found a solution (but I think it's weird).
You need to do 2 steps:
- Put some dummy file in your dir so it's not empty (either way you get
permission denied
error) - Create docker volume with
noserverino
option (found accidentally)
So in my case it's:
docker volume create --opt type=cifs --opt device=//10.0.75.1/hlds --opt o=username=dockeruser,password=docker,noserverino,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 somevol
And then:
docker run --rm -v somevol:/home/steam/opts -it krow7/hlds:1.0 bash
So you have your dirs owned by an exact user you need and can do all operations with files on a mounted share.
I hope someone will find it useful.
answered Mar 2 at 10:15
RomanRoman
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502954%2fmount-t-cifs-fails-with-permission-denied%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown