13 Commits

Author SHA1 Message Date
ec68f07c04 Fix Lint on Windows and enable the job
[NO NEW TESTS NEEDED] Purely refactoring

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-20 08:06:18 -05:00
2a2d0b0e18 chore: delete obsolete // +build lines
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 11:53:38 +02:00
280f5d8cb0 podman ssh work, using new c/common interface
implement new ssh interface into podman

this completely redesigns the entire functionality of podman image scp,
podman system connection add, and podman --remote. All references to golang.org/x/crypto/ssh
have been moved to common as have native ssh/scp execs and the new usage of the sftp package.

this PR adds a global flag, --ssh to podman which has two valid inputs `golang` and `native` where golang is the default.
Users should not notice any difference in their everyday workflows if they continue using the golang option. UNLESS they have been using an improperly verified ssh key, this will now fail. This is because podman was incorrectly using the
ssh callback method to IGNORE the ssh known hosts file which is very insecure and golang tells you not yo use this in production.

The native paths allows for immense flexibility, with a new containers.conf field `SSH_CONFIG` that specifies a specific ssh config file to be used in all operations. Else the users ~/.ssh/config file will be used.
podman --remote currently only uses the golang path, given its deep interconnection with dialing multiple clients and urls.

My goal after this PR is to go back and abstract the idea of podman --remote from golang's dialed clients, as it should not be so intrinsically connected. Overall, this is a v1 of a long process of offering native ssh, and one that covers some good ground with podman system connection add and podman image scp.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-08-09 14:00:58 -04:00
56d6ee0808 move golang.org/x/crypto/ssh/terminal to golang.org/x/term
golang.org/x/crypto/ssh/terminal is deprecated. The package was moved to
golang.org/x/term. golang.org/x/crypto/ssh/terminal was already just
calling golang.org/x/term itslef so there are no functional changes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-22 12:40:52 +02:00
6c030cd573 fix a number of godot issues
Still an unknown number remains but I am running out of patience.
Adding dots is not the best use of my time.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-22 13:04:35 +01:00
ea08765f40 go fmt: use go 1.18 conditional-build syntax
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-18 09:11:53 +01:00
c23f81fab6 Fix #11444: remote breaks with stdout redirection
`setConsoleMode` should do nothing if the handle is not a terminal. The proposed change is [exactly what `golang.org/x/term/IsTerminal()` does on Windows](https://cs.opensource.google/go/x/term/+/6886f2df:term_windows.go).

[NO TESTS NEEDED]

Signed-off-by: Anton Tykhyy <atykhyy@gmail.com>
2021-09-13 17:42:48 +03:00
320df83881 pkg/terminal: use c/storage/pkg/homedir
This also prunes the dependency on `k8s.io/client-go`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-08 09:21:13 +01:00
e9f4fb9759 Fix #9100 Change console mode message to debug
[NO TESTS NEEDED]

Signed-off-by: Gerard Braad <me@gbraad.nl>
2021-01-27 12:03:53 +08:00
7dd1da3787 Refine public key usage when remote
* Move all public key handling into one AuthMethod. Prioritize ssh-agent
  keys over identity files.
* Cache server connection when tunneling, saves one RoundTrip on ssh
  handshake

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-10 15:32:37 -07:00
83e54885ff Support hashed hostnames in the known_hosts file
Some systems have "HashKnownHosts yes" in their ssh_config

This causes entries in the ssh known_hosts to be hashed (|)

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2020-10-27 12:19:44 +01:00
dfb2f92583 Set console mode for windows
Windows terminal handling is different than darwin and linux.  It needs to have the terminal mode set to enable virtual terminal processing.  This allows colors and other things to work.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-29 09:17:55 -05:00
7377e578a9 V2 podman system connection
* Implement command
* Refactor podman-remote to pull from containers.conf by default
* podman-remote defaults to --remote being true
* Write podman-system-connection.1.md

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-23 08:18:53 -07:00