Files
teleport/lib/sshutils/close.go
T
Sasha Klizhentas a1116b7783 Set some defaults from identity file.
This commit reduces the amount of typing some users have
to do when using identity file:

* Teleport user is set from the certificate
* Auth preference is set to local

In addition it fixes several UX problems:

* Commands `tctl auth sign` and `tsh login -o`  now include
trusted CA keys in the identity file.

* Command `tsh ssh -i` is now noninteractive and only
uses identity file for authentication, in case
if identity file can not authenticate, no other interactive
or non-interactive authentication methods will be used.
Before this commit, tsh tried to fallback to interactive
login mode or read the keys from agent socket.
2018-09-13 16:47:14 -07:00

38 lines
874 B
Go

/*
Copyright 2015-2018 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package sshutils
import (
"io"
log "github.com/sirupsen/logrus"
)
func CloseAll(closers ...io.Closer) error {
var err error
for _, cl := range closers {
if cl == nil {
continue
}
if e := cl.Close(); e != nil {
log.Infof("%T close failure: %v", cl, e)
err = e
}
}
return err
}