简体   繁体   English

smbclient中的Shell脚本?

[英]Shell script inside smbclient?

I have problem with executing shell (bash) script inside smbclient. 我在smbclient中执行shell(bash)脚本时遇到问题。

It looks like this: 看起来像这样:

rafal@amilo:~/Desktop$ 
rafal@amilo:~/Desktop$ #script.sh is here
rafal@amilo:~/Desktop$ 
rafal@amilo: smbclient //host/user -U user%password
smb: \>
smb: \> #do some automatic things here: execute script.sh from rafal@amilo
smb: \>
smb: \>exit
rafal@amilo:~/Desktop$ #now i have new files in Desktop

How can I get this to work? 我该如何工作?

smbclient allow you to walk into samba directory. smbclient允许您进入samba目录。 If the target server is Windows, you won't (easily) be able to run "bash script", but you can't run "batch script" using dedicated tools. 如果目标服务器是Windows,则将无法(轻松)运行“ bash脚本”,但无法使用专用工具运行“ batch脚本”。 For exemple, you can use WinExec ( http://sourceforge.net/projects/winexe/ ) or SMBMap ( https://github.com/ShawnDEvans/smbmap ) 例如,您可以使用WinExec( http://sourceforge.net/projects/winexe/ )或SMBMap( https://github.com/ShawnDEvans/smbmap

Those tools have the same behaviour than PsExec from Sysinternals 这些工具的行为与Sysinternals的PsExec相同

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM