-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetBird SSH #361
NetBird SSH #361
Conversation
If an agent has been upgraded from any version without SSH support, all others won't receive an update indicating that SSH is now possible to this peer. |
client/internal/config.go
Outdated
@@ -145,7 +158,7 @@ func GetConfig(managementURL, adminURL, configPath, preSharedKey string) (*Confi | |||
} else { | |||
// don't overwrite pre-shared key if we receive asterisks from UI | |||
pk := &preSharedKey | |||
if preSharedKey == "**********" { | |||
if preSharedKey == "**********" || preSharedKey == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't dismiss empty string as sometimes user wants to remove a preshared key from its config
client/internal/engine.go
Outdated
//nil sshServer means it has not yet been started | ||
var err error | ||
e.sshServer, err = e.sshServerFunc(e.config.SSHKey, | ||
fmt.Sprintf("%s:%d", e.wgInterface.Address.IP.String(), 2222)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port should come from config for cases when port 2222 is already in use
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
|
||
engine := NewEngine(ctx, cancel, &signal.MockClient{}, &mgmt.MockClient{}, &EngineConfig{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets avoid using same interface configuration between tests
@@ -54,6 +55,8 @@ type EngineConfig struct { | |||
|
|||
// UDPMuxSrflxPort default value 0 - the system will pick an available port | |||
UDPMuxSrflxPort int | |||
|
|||
SSHKey []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should distinguish private and public ssh keys, here we store private key but other methods use sshKey for public SSH Key (e.g. Login)
client/ssh/util.go
Outdated
const RSAKeySize = 2048 | ||
|
||
// GeneratePrivateKey creates RSA Private Key of specified byte size | ||
func GeneratePrivateKey(t KeyType) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid using single-letter input variables
client/ssh/window_unix.go
Outdated
"unsafe" | ||
) | ||
|
||
func setWinSize(f *os.File, w, h int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid using single-letter input variables
client/ssh/window_windows.go
Outdated
"os" | ||
) | ||
|
||
func setWinSize(f *os.File, w, h int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid using single-letter input variables
management/server/grpcserver.go
Outdated
@@ -365,7 +384,8 @@ func toWiretrusteeConfig(config *Config, turnCredentials *TURNCredentials) *prot | |||
|
|||
func toPeerConfig(peer *Peer) *proto.PeerConfig { | |||
return &proto.PeerConfig{ | |||
Address: fmt.Sprintf("%s/%d", peer.IP.String(), SubnetSize), // take it from the network | |||
Address: fmt.Sprintf("%s/%d", peer.IP.String(), SubnetSize), // take it from the network | |||
SshConfig: &proto.SSHConfig{SshEnabled: true}, //TODO REMOVE THIS HARDCODED VALUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove hardcoded flag
This PR adds support for SSH access through the NetBird network without managing SSH skeys. NetBird client app has an embedded SSH server (Linux/Mac only) and a netbird ssh command.
No description provided.