7/1/2023 0 Comments Ssh copy a direcotyThen the contents of /foo on the local machine will be uploaded to If the source is /foo (no trailing slash), and the destination is /tmp, The existence of a trailing slash on the source path will determine whether theĭirectory name will be embedded within the destination, or whether theĭestination will be created. When using the winrm connection type the destination directory will beĬreated for you if it doesn't already exist. The file provisioner in order to create the directory If you need to create it, use a remote-exec provisioner just prior to When using the ssh connection type the destination directory must alreadyĮxist. When uploading a directory, there are some additional considerations. The file provisioner can upload a complete directory to the remote machine. Recommend choosing SSH over WinRM whereever possible, and using WinRM only asĪ last resort when working with obsolete Windows versions. Modern Windows systems support running an OpenSSH server, so we strongly Your destination argument when using WinRM, because it can serve as a vectorįor arbitrary PowerShell code execution on the remote system. In particular, avoid including any untrusted external input in In the WinRM case, the destination path is therefore interpreted by PowerShellĪnd so you must take care not to use any meta-characters that PowerShell might
0 Comments
Leave a Reply. |