Skip to content

Commit 046d95f

Browse files
committed
Set HOME
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 90382bf commit 046d95f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ func handleConnection(conn net.Conn) {
5959
// Set environment variables to make it look like SSH
6060
shellCmd.Env = append(os.Environ(),
6161
"SSH_TTY=/dev/pts/0",
62-
"TERM=xterm-256color")
62+
"TERM=xterm-256color",
63+
"HOME=/root/")
64+
65+
shellCmd.Dir = "/root/"
6366

6467
if _, err := os.Stat("/etc/update-motd.d/"); err == nil {
6568
shellCmd.Args = append(shellCmd.Args, "-c", "/usr/bin/run-parts /etc/update-motd.d/; exec bash")

0 commit comments

Comments
 (0)