首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Smbclient询问密码

Smbclient询问密码
EN

Unix & Linux用户
提问于 2016-05-27 15:04:39
回答 1查看 48.9K关注 0票数 10

我正在使用以下命令连接到samba共享。

代码语言:javascript
复制
/usr/bin/smbclient \\\\server78\\publicfolder

它在连接之前向我询问我的linux帐户密码。

如果我手动运行它,这不是问题,但是我如何在bash脚本中使用它而不问我密码呢?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2016-05-27 15:24:17

这应该是可能的。

来自man smbclient

代码语言:javascript
复制
  -U|--user=username[%password]
       Sets the SMB username or username and password.
       If %password is not specified, the user will be prompted.

所以你可以用这样的东西:

代码语言:javascript
复制
/usr/bin/smbclient \\\\server78\\publicfolder -U=user%password
票数 9
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/285941

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档