我正在使用以下命令连接到samba共享。
/usr/bin/smbclient \\\\server78\\publicfolder它在连接之前向我询问我的linux帐户密码。
如果我手动运行它,这不是问题,但是我如何在bash脚本中使用它而不问我密码呢?
发布于 2016-05-27 15:24:17
这应该是可能的。
来自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%passwordhttps://unix.stackexchange.com/questions/285941
复制相似问题