왜 cli에서 로그인하면 mac smb connect가 실패하지만 finder 및 guest 계정에서는 작동합니까?


8

그래서 많은 사용자가 읽기 전용 폴더를 공유하는 하나의 mac (Yosemite)이 있으며 게스트 계정은 해당 폴더를 마운트 / 액세스 할 수 있으므로 사용자가 무엇이든 다운로드 할 수 있습니다. 다른 Mac (Sierra)의 관리자로서 공유에 연결하고 있습니다. 명령 줄에서 게스트 사용자로 실행할 때 작동합니다.

mount_smbfs //guest@macbook-pro.local/Files /tmp/files
ls /tmp/files
fileA    fileB

또는 손님으로 finder에서 연결하는 경우 :

click MacBook-Pro -> Connect As -> Guest -> Connect
double click Files
ls /Volumes/Files
fileA    fileB

이제 Mac (Yosemite)에 하나의 관리자 계정이 있습니다. 읽기 쓰기 권한으로 해당 폴더에 마운트 / 액세스하고 싶지만 명령 줄에서 사용자 이름이 필요한 경우 로그인으로 폴더를 마운트하려는 모든 시도가 실패합니다.

mount_smbfs //admin@macbook-pro.local/Files /tmp/files
Password for MacBook-pro.local:
mount_smbfs: server rejected the connection: Authentication error

그러나 Finder에 연결하면 :

click MacBook-Pro -> Connect As -> Registered User
Username: admin
Password: password
 -> Connect
double click Files
ls /Volumes/Files
fileA    fileB

성공적인 연결의 모든 경우에 시스템 속성의 서버 공유 섹션에서 파일 공유 : 켜기-> 옵션 ...을 클릭하면

Share files and folders using SMB
  Number of users connected: 1

인증이 필요한 계정을 사용하여 명령 행으로 smb로 연결을 시도 할 때 연결이 거부 된 이유를 추측 할 수 있습니까?

편집하다

예, AFP connect는 암호를 요구하는 계정으로 cli를 포함한 모든 경우에 작동합니다. 예를 들면 다음과 같습니다.

mount_afp -i afp://admin@macbook-pro.local/Files /tmp/files
Password: 
ls /tmp/files
fileA    fileB

테스트를 위해 나는 경우에 대비하여 smb 인증 규칙을 낮추려고 시도했지만 일반 텍스트로 암호를 보내더라도 아무런 효과가 없었습니다. 따라서 :

sudo nano /etc/nsmb.conf
   [default]
   minauth=none
^c+X
mount_smbfs smb://admin:password@macbook-pro.local/Files /tmp/files
mount_smbfs: server rejected the connection: Authentication error

편집 2

누구나이 문제에 대한 정보를 얻을 수있는 경우를 대비 한 로그 파일이 있습니다. 로그를 오프 사이트에 게시하는 것이 유감이지만 성공적인 로그에 텍스트가 너무 많습니다.

먼저, 흐름을 사용하여 Finder를 통해 SMB를 통해 MacBook-Pro.local에 연결하는 클라이언트 로그는 다음과 같습니다.

Click MacBook-Pro
Connect As: Registered User
Name: admin
Password: password
Connect

콘솔에서 다음과 같은 로그 출력을 생성합니다.

http://paste.ubuntu.com/23308183/

이제 모든 공유 폴더 목록을 관리자가 사용할 수 있습니다. 따라서 파일 폴더를 클릭하면 다음과 같이 더 많은 로그 출력이 생성됩니다.

http://paste.ubuntu.com/23308186/

파일 폴더가 마운트되고 관리자가 읽고 쓸 수 있습니다

비교를 위해 다음은 순수 명령 행 도구 mount_smbfs를 사용하여 자원에 연결하려고 할 때 콘솔의 로그입니다.

default 09:43:21.257429 -0400   gamed   GKClientProxy: clientForBundleID:
default 09:43:21.257543 -0400   gamed   GKClientProxy: updateIfRecentlyInstalled
default 09:43:21.258623 -0400   gamed   GKClientProxy: clientForBundleID:
default 09:43:21.258751 -0400   gamed   GKClientProxy: updateIfRecentlyInstalled
default 09:43:21.277114 -0400   opendirectoryd  Client: <private>, UID: 0, EUID: 0, GID: 0, EGID: 0
default 09:43:21.277194 -0400   opendirectoryd  <private> completed, delivered 1 result
default 09:43:22.025420 -0400   mount_smbfs subsystem: com.apple.SystemConfiguration, category: SCPreferences, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
default 09:43:22.030767 -0400   mount_smbfs subsystem: com.apple.network, category: , enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
default 09:43:22.069146 -0400   opendirectoryd  Client: <private>, UID: 0, EUID: 0, GID: 0, EGID: 0
default 09:43:22.069231 -0400   opendirectoryd  <private> completed, delivered 1 result
default 09:43:22.069385 -0400   opendirectoryd  Client: <private>, UID: 0, EUID: 0, GID: 0, EGID: 0
default 09:43:22.069479 -0400   opendirectoryd  <private> completed, delivered 1 result
default 09:43:22.072139 -0400   opendirectoryd  Client: <private>, UID: 502, EUID: 502, GID: 20, EGID: 20
default 09:43:22.072212 -0400   opendirectoryd  <private> completed, delivered 1 result
error   09:43:22.146661 -0400   kernel  loginwindow is not entitled
error   09:43:22.146708 -0400   kernel  loginwindow is not entitled
error   09:43:22.146799 -0400   kernel  UserEventAgent is not entitled
error   09:43:22.146882 -0400   kernel  UserEventAgent is not entitled
default 09:43:22.886004 -0400   AppleIDAuthAgent    SERVER Doing account check for "a...n@???????.???". (scheduledAccountCheckDispatcher()/AppleIDAuthd.cpp #545) accountCheckDispatch
default 09:43:22.886074 -0400   AppleIDAuthAgent    Checking account <private>
default 09:43:22.887673 -0400   AppleIDAuthAgent    _AppleIDAuthAccountForAppleID falling back to account aliases

error   09:43:22.891028 -0400   AppleIDAuthAgent    ### Request GS token for '<private>' start failed: -101
default 09:43:22.891078 -0400   AppleIDAuthAgent    ### Authenticate '<private>' failed: <private>
default 09:43:22.891158 -0400   AppleIDAuthAgent    SERVER Didn't succeed with .authenticate, and error is ERROR:"CSIdentityErrorDomain" #-101 kCSIdentityAppleIDInvalidAccountOrPasswordErr {  } so releasing session. (___Z31__AppleIDSessionDoCreateSessionPK10__CFStringS1_PK14__CFDictionaryPS1_PS4_PP9__CFError_block_invoke()/AppleIDXMLServerCommunications.cpp #902) queue.session.
default 09:43:22.891399 -0400   AppleIDAuthAgent    Next time for '<private>': 2016-10-11 13:43:22 +0000 (497886202.891342 + 0.000000), 0.000000 seconds
default 09:43:22.891514 -0400   AppleIDAuthAgent    Next time for '<private>': 2016-10-11 13:43:22 +0000 (497886202.891467 + 0.000000), 0.000000 seconds
default 09:43:22.891560 -0400   AppleIDAuthAgent    Next action time for <private>: <private> (because the account does not have a certificate nor an uploaded csr)
default 09:43:25.393805 -0400   CommCenter  #watchdog #I Callback Watchdog: checkin 119
default 09:43:25.394014 -0400   CommCenter  #watchdog #I Server Watchdog: checkin 119
default 09:43:28.212369 -0400   opendirectoryd  Client: <private>, UID: 502, EUID: 502, GID: 20, EGID: 20
default 09:43:28.212476 -0400   opendirectoryd  <private> failed with error '<private>' (2)
default 09:43:29.061659 -0400   kernel  SmartBattery: finished polling type 4
default 09:43:29.847392 -0400   gamed   GKClientProxy: clientForBundleID:
default 09:43:29.847446 -0400   gamed   GKClientProxy: updateIfRecentlyInstalled
default 09:43:29.847970 -0400   gamed   GKClientProxy: clientForBundleID:
default 09:43:29.847992 -0400   gamed   GKClientProxy: updateIfRecentlyInstalled
default 09:43:29.879093 -0400   opendirectoryd  Client: <private>, UID: 0, EUID: 0, GID: 0, EGID: 0
default 09:43:29.879183 -0400   opendirectoryd  <private> completed, delivered 1 result

해결 방법

이 AppleScript 코드 조각이 명령 줄에서 작동한다는 것을 알았습니다.

osascript -e 'tell application "Finder" to mount volume "smb://admin:password@macbook-pro.local/Files"'

비밀번호 필드가 채워진 확인 창을 시작합니다. 그러나 비밀번호를 일반 텍스트로 입력해야합니다. 암호없이 수행 할 수 있으며 매번 입력 할 수도 있습니다.

osascript -e 'tell application "Finder" to mount volume "smb://admin@macbook-pro.local/Files"'

그래서 암호를 저장하려고했습니다. 로그인을 키 체인에 저장하기 위해 상자를 체크 한 후, 평문에 암호를 입력하지 않아도 동일한 명령이 성공하지만 암호 상자가 채워져 있고 "암호 기억"상자도 선택된 확인 창이 나타납니다.

비밀번호를 저장 한 후에도 여전히 mount_smbfs 연결에 적용되지 않았습니다. 마운트 시도가 실패했습니다.

아마도이 osascript 아이디어는 해결 방법 일지 모르지만 samba가 finder로 연결되지만 cli를 사용하지 않는 이유에 대한 대답은 아닙니다.


AFP를 통해 연결을 시도해도 작동하는지 확인할 수 있습니까?
NoahL

도움을 주셔서 감사합니다. 모든 경우에 반드시 AFP에서 작동합니다. 손님 또는 비밀번호가 필요한 사용자인지 여부에 관계없이 Finder, 명령 행 및 스크립트
ndasusers 2016

이것을 시도하십시오 : 서버에서 시스템 환경 설정-> 공유로 이동하십시오. 창의 중앙에는 녹색 원이 있습니다. 그 옆에있는 창의 왼쪽 중앙에 "파일 공유 : 설정"이라고 표시되어 "옵션 ..."을 누르십시오. 드롭 다운에서 "smb를 사용하여 파일 및 폴더 공유"
NoahL

그 방법을 알려주세요
NoahL

다시 감사합니다. 파일 공유 : on, smb를 사용한 파일 공유가 이미 활성화되어 있습니다. 성공적으로 연결되면 사용자는 해당 창에서도 번호가 매겨집니다.
ndasusers

답변:


-2

GKClientProxy : clientForBundleID : 4


3
Ask Different에 오신 것을 환영합니다. 답변 해 주셔서 감사합니다! 우리는 항상 해결책을 찾고 있으며 다음과 같은 정보를 제공하는 답변을 선호합니다. 또는 추천하는 제품. 이와 같은 추가 정보는 OP 및 기타 정보에 도움이 될 수 있습니다. 여기에 답변을 제공하는 방법에 대한 팁은 답변 방법을 참조 하십시오.
Monomeeth
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.