简体   繁体   中英

Shell script inside smbclient?

I have problem with executing shell (bash) script inside smbclient.

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. 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. For exemple, you can use WinExec ( http://sourceforge.net/projects/winexe/ ) or SMBMap ( https://github.com/ShawnDEvans/smbmap )

Those tools have the same behaviour than PsExec from Sysinternals

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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