Want to copy directory from linux machine to windows (SMB) with shell script.
[user@host home]$ smbclient -W WORKGROUP --user='admin%admin$123' -c "put /data/directory" "//192.168.1.1/share"
Domain=[mydomain] OS=[Windows Server] Server=[Windows Server]
/data/directory does not exist
[user@host home]$ cd /data/directory
/data/directory
[user@host directory]$ ll
File1
File2
..
Here is the issues:
Not accept password even when I use (
-N)even try this
--user=admin%admin$123
When I remove password from command and shell ask me password it works!
FYI: for transferring directory between Windows and Linux I read about curl, and SSH daemon on windows for scp, do you have any recommendation or simple way, without require additional service on Windows or package on Linux?
“and”characters in your code used to be", while the—characters were originally-. Am I right? If so, please edit your question, replacing the characters that were not in the command you actually tried. It will help other users in ruling out possible issues.smbclientaccepts a--passoption? (My does not). 2) Your issue may depend on the characters in your password (e.g$). You should single-quote the password string, to input it literally, or double-quote it, if you store it in a variable. Possibly--user='admin%admin$123'.