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

Failed to use against shell other than bash #14

Open
yookoala opened this issue Jan 4, 2018 · 2 comments
Open

Failed to use against shell other than bash #14

yookoala opened this issue Jan 4, 2018 · 2 comments

Comments

@yookoala
Copy link
Contributor

yookoala commented Jan 4, 2018

I tried to run sga-guard to forward to a remove server, which uses fish as default shell. This is the response I got:

Connecting to [email protected] to set up forwarding...
Failed to run remote stub: fish: Variables may not be used as commands. In fish, please define a function or use 'eval $SHELL'.
$SHELL -l -c "exec sga-stub"
^

Make sure that guardian agent is properly installed on the remote host

If I switch the default shell of the remote user ([email protected]) to /bin/bash, the forwarding would be successful. That means the agent depends on the behaviour of specific shell environment, which is not ideal.

Please fix this if possible. Thanks.

@yookoala
Copy link
Contributor Author

yookoala commented Jan 4, 2018

Temporary workaround is to specify sga-stub location directly. If your sga-stub is installed in the $PATH of your remote environment, this should be easy:

sga-guard --stub="sga-stub" [email protected]

Please note if the sga-stub is not in $PATH of the remote user, the --stub= value should be the full path to the sga-stub binary there.

@frederickjh
Copy link

I believe that the fix the Fish shell is suggestion would also work on Bash as well. So changing line 29 of /cmd/sga-guard-bin/sga-guard-bin.go from:

RemoteStubName string `long:"stub" description:"Remote stub executable path" default:"$SHELL -l -c \"exec sga-stub\""`

to

RemoteStubName string `long:"stub" description:"Remote stub executable path" default:"eval $SHELL -l -c \"exec sga-stub\""`

Quoting may need some work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants