
NetApp CIFS 共有をサーバーの 1 つにマウントしようとしているのですが、stderr に「Permission Denied」と表示され、NT_STATUS_WRONG_PASSWORD
実行中の にも表示されますdmesg
。
root@xxxehpvld05 ~ $ mount.cifs -vv //zhp-nas.xxx.com/perspectives /mnt/secure/cifs -o credentials=/etc/cifs.creds
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
root@xxxehpvld05 ~ $ dmesg | tail
CIFS VFS: cifs_mount failed w/return code = -13
Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD
CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/return code = -13
Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD
CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/return code = -13
Status code returned 0xc000006a NT_STATUS_WRONG_PASSWORD
CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/return code = -13
ただし、コマンドsmbclient
はまったく同じ資格情報ファイルを使用して問題なく動作します。
root@xxxehpvld05 ~ $ smbclient -L //zhp-nas.xxx.com/perspectives -A /etc/cifs.creds
Domain=[XXX] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
IPC$ IPC Remote IPC
ZHPSubmit-dev Disk
[...snip...]
特に資格情報ファイルでもドメイン名が指定されているため、一方が機能する場合はもう一方も機能するはずです。
答え1
詳細情報がないため、確実なことは言えませんが、古いプロトコル バージョンを実行している古い Windows サーバーに接続したときにこの問題が発生したことがあります。CIFS は SMB の「方言」(タイプ) と見なされていることに留意してください。他のタイプもあり、古いセットアップでは CIFS は使用されません。
基本的に、2 人の人が話していると言っているようなものです。1 人はスペイン語、もう 1 人は英語で、明らかに英語を話す人にスペイン語を理解させようとしますが、スペイン語を理解できないのは明らかです。
SMBclient は、セキュリティ ネゴシエーションに異なる方言を使用します (または少なくとも異なる方法で検出します)。
試す
マウント -t cifs //path/thing/ /mount/point -o username=user,password=pass,秒 = ntlm
何が起こるか見てみましょう。(sec=ntlm が重要な部分です)
答え2
コマンドをいろいろ試してみたところ、考えられる理由が見つかりました:
smbclient のマニュアルページから:
-A|--authentication-file=filename
This option allows you to specify a file from which to read the
username and password used in the connection. The format of the file is
username = <value>
password = <value>
domain = <value>
Make certain that the permissions on the file restrict access from
unwanted users.
mount.cifs のマニュアルページから:
credentials=filename
specifies a file that contains a username and/or password and
optionally the name of the workgroup. The format of the file is:
username=value
password=value
domain=value
次に、最初のスニペットに示すようにスペースを含む資格情報ファイルとスペースを含まない資格情報ファイルの 2 つを作成し、それぞれに および という名前を付けましcreds
たcreds.spacy
。
大決戦:
ファイルありcreds
:
mount.cifs -vvv //host/path /local/path -o credentials=/path/creds
静粛性も良好、エラーもなし。
ファイルありcreds.spacy
:
# mount.cifs -vvv //host/path /local/path -o credentials=/path/creds.spacy
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
したがって、資格情報ファイルにはスペースが含まれていることは明らかですが、これは mount.cifs では認識されません。
さらに、スペースsmbclient
があっても問題ありません。不満も生じませんでした。creds
creds.spacy
答え3
今日共有をマウントしようとしたときに発見したもう 1 つの可能性は、ドメイン内のユーザーを資格情報として提供する構文をsmbmount
サポートしていることです。username=DOMAIN\\user
mount.cifs
(および) が機能するにはmount -t cifs
、これら 2 つを別々に提供する必要があります-o username=user,password=pass,dom=DOMAIN
。
答え4
user55518 が説明したように、資格情報ファイルには、見えなくてもスペースが含まれている可能性があります。資格情報ファイルを Windows で編集した場合、\r
行末にスペースが含まれている可能性があり、エラー 13 が発生します。