diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 245f3ceb0..07fb1eaa2 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -336,7 +336,7 @@ func scpUploadFile(dst string, src io.Reader, w io.Writer, r *bufio.Reader, fi * var mode os.FileMode var size int64 - if fi != nil { + if fi != nil && (*fi).Mode().IsRegular() { mode = (*fi).Mode().Perm() size = (*fi).Size() } else {