mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Use login shells in terminals
This commit is contained in:
@@ -111,7 +111,7 @@ func (r *registry) execContainer(containerID string, req xfer.Request) xfer.Resp
|
||||
AttachStdout: true,
|
||||
AttachStderr: true,
|
||||
Tty: true,
|
||||
Cmd: []string{"/bin/sh", "-c", "TERM=xterm exec $( (type getent > /dev/null 2>&1 && getent passwd root | cut -d: -f7 2>/dev/null) || echo /bin/sh)"},
|
||||
Cmd: []string{"/bin/sh", "-l", "-c", "TERM=xterm exec $( (type getent > /dev/null 2>&1 && getent passwd root | cut -d: -f7 2>/dev/null) || echo /bin/sh)"},
|
||||
Container: containerID,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package host
|
||||
|
||||
func getHostShellCmd() []string {
|
||||
return []string{"/bin/bash"}
|
||||
return []string{"/bin/bash", "-l"}
|
||||
}
|
||||
|
||||
@@ -23,12 +23,12 @@ func getHostShellCmd() []string {
|
||||
"/usr/bin/nsenter", "-t1", "-m", "-i", "-n", "-p", "--no-fork",
|
||||
"--setuid", uid,
|
||||
"--setgid", gid,
|
||||
shell,
|
||||
shell, "-l",
|
||||
}
|
||||
}
|
||||
|
||||
_, _, shell := getRootUserDetails([]string{"cat", "/etc/passwd"})
|
||||
return []string{shell}
|
||||
return []string{shell, "-l"}
|
||||
}
|
||||
|
||||
func getRootUserDetails(readPasswdCmd []string) (uid, gid, shell string) {
|
||||
|
||||
Reference in New Issue
Block a user