Skip to content

Commit

Permalink
chdir to /mnt/code
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi committed Jan 1, 2025
1 parent 28c5fe3 commit 4567596
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/abstractions/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func (ss *SSHShellService) CreateShell(ctx context.Context, in *pb.CreateShellRe
TOKEN='%s';
useradd -m -s /bin/bash "$USERNAME";
echo "$USERNAME:$TOKEN" | chpasswd;
echo "cd /mnt/code" >> "/home/$USERNAME/.bashrc";
sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config;
sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication no/' /etc/ssh/sshd_config;
echo "AllowUsers $USERNAME" >> /etc/ssh/sshd_config;
Expand Down

0 comments on commit 4567596

Please sign in to comment.