Commit Graph

4 Commits

Author SHA1 Message Date
Gordon Messmer 9c69ae85ec Support the execution of SSH commands with optional input.
Because the SSH exec functions do not currently support execution with
input, some users (such as the podman-image-scp) must operate in two
phases, first copying a file to the remote host, and then executing a
command with shell redirection and removing the temporary file.

This API extension allows those users to simplify their code and
avoid the use of temporary files.

Signed-off-by: Gordon Messmer <gordon.messmer@gmail.com>
2024-02-07 09:05:31 -08:00
Daniel J Walsh bb2e6fbeb9 Default to port 22 when dialing
[NO NEW TESTS NEEDED]

Fixes: https://github.com/containers/podman/issues/19162

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-21 13:00:00 -04:00
Valentin Rothberg e17483b871 bump to golangci-lint v1.50.0
Used `go fmt` rules to migrate away from deprecated functions, for
instance `gofmt -w -s -r 'ioutil.TempDir(a, b) -> os.MkdirTemp(a, b)'`

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-17 15:03:07 +02:00
Charlie Doern 64be63d976 ssh package
initial implementation of the ssh package including:

- nativeConnectionCreate() / golangConnectionCreate()
- n/a / golangConnectionDial()
- nativeConnectionScp() / golangConnectionScp()
- nativeConnectionExec() / golangConnectionExeC()

the way this works, is there are publicly accessible functions Create, Exec, Dial and Scp. podman will have a new global flag --ssh` that will allow users to choose native or golang based ssh functions. The functionality in containers/common (here) also checks if you have the necessary binaries installed

closes #1091

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-08-08 09:22:46 -04:00