mirror of
https://github.com/containers/podman.git
synced 2025-06-13 19:52:11 +08:00
podman machine ssh handling
add the key used in newly initialized machines to the user's known_hosts file. This ensures that golang will be able to ssh into the machine using podman-remote. Also, remove the /dev/null redirection for podman machine ssh's known_hosts file. resolves #15347 Signed-off-by: Charlie Doern <cdoern@redhat.com> Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
This commit is contained in:
5
vendor/github.com/containers/common/pkg/ssh/utils.go
generated
vendored
5
vendor/github.com/containers/common/pkg/ssh/utils.go
generated
vendored
@ -21,6 +21,7 @@ func Validate(user *url.Userinfo, path string, port int, identity string) (*conf
|
||||
if strings.Contains(path, "/run") {
|
||||
sock = strings.Split(path, "/run")[1]
|
||||
}
|
||||
// url.Parse NEEDS ssh://, if this ever fails or returns some nonsense, that is why.
|
||||
uri, err := url.Parse(path)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@ -33,9 +34,9 @@ func Validate(user *url.Userinfo, path string, port int, identity string) (*conf
|
||||
|
||||
if uri.Port() == "" {
|
||||
if port != 0 {
|
||||
uri.Host = net.JoinHostPort(uri.Hostname(), strconv.Itoa(port))
|
||||
uri.Host = net.JoinHostPort(uri.Host, strconv.Itoa(port))
|
||||
} else {
|
||||
uri.Host = net.JoinHostPort(uri.Hostname(), "22")
|
||||
uri.Host = net.JoinHostPort(uri.Host, "22")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user