mount.cifs는 smbclient에서 사용하는 것과 동일한 자격 증명 파일을 사용할 수 없습니다.

mount.cifs는 smbclient에서 사용하는 것과 동일한 자격 증명 파일을 사용할 수 없습니다.

NetApp CIFS 공유를 우리 서버 중 하나에 마운트하려고 하는데 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를 사용하지 않습니다.

기본적으로 두 사람이 이야기하는 것과 같습니다. 스페인어 하나와 영어 하나, 영어 사용자에게 스페인어를 이해하도록 강요하려고 하지만 그는 확실히 이해하지 못합니다.

SMB클라이언트는 보안 협상을 위해 다른 방언을 사용합니다. (또는 적어도 차이점을 감지하십시오).

노력하다

mount -t cifs //경로/사물/ /mount/point -o 사용자 이름=사용자, 비밀번호=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

그런 다음 두 개의 자격 증명 파일을 생성했습니다. 하나는 첫 번째 스니펫에 표시된 것처럼 공백이 있고 다른 하나는 공백이 없으며 이름을 모두 credscreds.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

오늘 공유를 마운트하려고 시도하면서 발견한 또 다른 가능성은 도메인의 사용자에게 자격 증명을 smbmount제공하는 것을 지원하는 구문입니다 .username=DOMAIN\\user

mount.cifs(및 mount -t cifs)이 작동 하려면 다음 두 가지를 별도로 제공해야 합니다 -o username=user,password=pass,dom=DOMAIN.

답변4

user55518이 설명했듯이 자격 증명 파일에는 표시되지 않더라도 공백이 있을 수 있습니다. Windows에서 자격 증명 파일을 편집한 경우 \r줄 끝에서 편집되어 오류 13이 발생할 수 있습니다.

관련 정보