SMB클라이언트에 비밀번호가 필요합니다

SMB클라이언트에 비밀번호가 필요합니다

다음 명령을 사용하여 삼바 공유에 연결하고 있습니다.

/usr/bin/smbclient \\\\server78\\publicfolder

연결하기 전에 Linux 계정 비밀번호를 요청했습니다.

수동으로 실행하면 문제가 되지 않지만, 비밀번호를 묻지 않고 bash 스크립트에서 어떻게 사용합니까?

답변1

가능해야합니다.
에서 man smbclient:

  -U|--user=username[%password]
       Sets the SMB username or username and password.
       If %password is not specified, the user will be prompted.

따라서 다음과 같은 것을 사용할 수 있습니다.

/usr/bin/smbclient \\\\server78\\publicfolder -U=user%password

관련 정보