mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-09 15:25:20 +02:00
Load user profile when SSH (#380)
This PR fixes issues with the terminal when running netbird ssh to a remote agent. Every session looks up a user and loads its profile. If no user is found, the connection is rejected. The default user is root.
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package util
|
||||
|
||||
import "os"
|
||||
|
||||
// SliceDiff returns the elements in slice `x` that are not in slice `y`
|
||||
func SliceDiff(x, y []string) []string {
|
||||
mapY := make(map[string]struct{}, len(y))
|
||||
@ -14,3 +16,9 @@ func SliceDiff(x, y []string) []string {
|
||||
}
|
||||
return diff
|
||||
}
|
||||
|
||||
// FileExists returns true if specified file exists
|
||||
func FileExists(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
return err == nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user