diff --git a/pkg/abstractions/shell/shell.go b/pkg/abstractions/shell/shell.go index 98b13a57a..16e5fea4a 100644 --- a/pkg/abstractions/shell/shell.go +++ b/pkg/abstractions/shell/shell.go @@ -219,12 +219,16 @@ func (ss *SSHShellService) CreateShell(ctx context.Context, in *pb.CreateShellRe startupCommand := fmt.Sprintf(` set -e; - USERNAME='beam'; + USERNAME='root'; TOKEN='%s'; - useradd -m -s /bin/bash "$USERNAME"; echo "$USERNAME:$TOKEN" | chpasswd; - echo "cd /mnt/code" >> "/home/$USERNAME/.bashrc"; + echo "if [ -f /root/.bashrc ]; then . /root/.bashrc; fi" >> "/root/.profile"; + echo "cd /mnt/code" >> "/root/.profile"; + echo "export TERM=xterm-256color" >> "/root/.bashrc"; + echo "alias ls='ls --color=auto'" >> "/root/.bashrc"; + echo "alias ll='ls -lart --color=auto'" >> "/root/.bashrc"; sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config; + sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config; sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication no/' /etc/ssh/sshd_config; echo "AllowUsers $USERNAME" >> /etc/ssh/sshd_config; exec /usr/sbin/sshd -D -p 8001 diff --git a/sdk/src/beta9/abstractions/mixins.py b/sdk/src/beta9/abstractions/mixins.py index f3ee91c49..1ac487785 100644 --- a/sdk/src/beta9/abstractions/mixins.py +++ b/sdk/src/beta9/abstractions/mixins.py @@ -111,7 +111,7 @@ def shell(self, url_type: str = ""): container_id=container_id, stub_id=self.parent.stub_id, auth_token=self.parent.config_context.token, - username="beam", + username="root", password=ssh_token, ) as shell: shell.start()