1diff --git a/shells/bash.go b/shells/bash.go
2index 18d608445..f158ffc0b 100644
3--- a/shells/bash.go
4+++ b/shells/bash.go
5@@ -3,6 +3,7 @@ package shells
6 import (
7 "bytes"
8 "fmt"
9+ "os/exec"
10 "path"
11 "runtime"
12 "strconv"
13@@ -307,7 +308,11 @@ func (b *BashShell) GetConfiguration(info common.ShellScriptInfo) (*common.Shell
14
15 script.Command = "su"
16 if runtime.GOOS == OSLinux {
17- script.Arguments = []string{"-s", "/bin/" + b.Shell, info.User, "-c", script.CmdLine}
18+ shellPath, err := exec.LookPath(b.Shell)
19+ if err != nil {
20+ shellPath = "/bin/" + b.Shell
21+ }
22+ script.Arguments = []string{"-s", shellPath, info.User, "-c", script.CmdLine}
23 } else {
24 script.Arguments = []string{info.User, "-c", script.CmdLine}
25 }