Skip to content
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

Invalid multiplex command on Ubuntu 18.04 #323

Closed
pschmitt opened this issue Sep 22, 2019 · 2 comments · Fixed by #326
Closed

Invalid multiplex command on Ubuntu 18.04 #323

pschmitt opened this issue Sep 22, 2019 · 2 comments · Fixed by #326

Comments

@pschmitt
Copy link
Contributor

When using the native ssh client on Ubuntu 18.04 assh invokes an invalid ssh command (ssh -o false -O false test.example.com)

Example:

$ /usr/bin/ssh -V
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
$ assh --config /dev/null -D --verbose wrapper ssh test.example.com                                                                                                                          
2019-09-22T14:42:27.650+0200	DEBUG	assh.pkg.commands	commands/wrapper.go:62	Wrapper called	{"bin": "/usr/bin/ssh", "target": "test.example.com", "command": [], "options": ["-O", "false", "-o", "false"], "sshArgs": ["ssh", "-O", "false", "-o", "false", "test.example.com"]}
2019-09-22T14:42:27.650+0200	DEBUG	assh.pkg.config	config/config.go:518	Loading config file	{"file": "/dev/null"}
2019-09-22T14:42:27.651+0200	DEBUG	assh.pkg.config	config/config.go:536	Loaded config file	{"file": "/dev/null", "num-host-before": 0, "num-host-after": 0, "num-host-diff": 0}
Invalid multiplex command.
@pschmitt
Copy link
Contributor Author

I managed to fix it with this:

diff --git pkg/commands/wrapper.go pkg/commands/wrapper.go
index 71af6314..65e9c474 100644
--- pkg/commands/wrapper.go
+++ pkg/commands/wrapper.go
@@ -46,6 +46,14 @@ func runSSHWrapperCommand(cmd *cobra.Command, args []string) error {
 	}
 	for _, flag := range config.SSHStringFlags {
 		for _, val := range viper.GetStringSlice(flag) {
+			if (flag == "o" || flag == "O") && val == "false" {
+				logger().Debug(
+					"Skip invalid option:",
+					zap.String("flag", flag),
+					zap.String("val", val),
+				)
+				continue
+			}
 			options = append(options, fmt.Sprintf("-%s", flag))
 			options = append(options, val)
 		}

@github-actions
Copy link

🎉 This issue has been resolved in version 2.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@moul moul added this to To do in Kanban via automation Jun 7, 2020
@moul moul added this to the v2 ✌ milestone Jun 7, 2020
@moul moul moved this from To do to Done in Kanban Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants