Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions runner/internal/shim/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,6 @@ func getSSHShellCommands(openSSHPort int, publicSSHKey string) []string {
`if _exists apk; then _install() { apk add -U "$1"; }; fi`,
// check in sshd is here, install if not
`if ! _exists sshd; then _install openssh-server; fi`,
// prohibit password authentication
"sed -i \"s/.*PasswordAuthentication.*/PasswordAuthentication no/g\" /etc/ssh/sshd_config",
// create ssh dirs and add public key
"mkdir -p ~/.ssh",
"chmod 700 ~/.ssh",
Expand All @@ -876,7 +874,7 @@ func getSSHShellCommands(openSSHPort int, publicSSHKey string) []string {
"rm -rf /run/sshd && mkdir -p /run/sshd && chown root:root /run/sshd",
"rm -rf /var/empty && mkdir -p /var/empty && chown root:root /var/empty",
// start sshd
fmt.Sprintf("/usr/sbin/sshd -p %d -o AllowTcpForwarding=yes -o PermitUserEnvironment=yes", openSSHPort),
fmt.Sprintf("/usr/sbin/sshd -p %d -o PidFile=none -o PasswordAuthentication=no -o AllowTcpForwarding=yes -o PermitUserEnvironment=yes", openSSHPort),
// restore ld.so variables
`if [ -n "$_LD_LIBRARY_PATH" ]; then export LD_LIBRARY_PATH="$_LD_LIBRARY_PATH"; fi`,
`if [ -n "$_LD_PRELOAD" ]; then export LD_PRELOAD="$_LD_PRELOAD"; fi`,
Expand Down
4 changes: 1 addition & 3 deletions src/dstack/_internal/core/backends/base/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,6 @@ def get_docker_commands(
"if ! _exists sshd; then _install openssh-server; fi",
# install curl if necessary
"if ! _exists curl; then _install curl; fi",
# prohibit password authentication
'sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config',
# create ssh dirs and add public key
"mkdir -p ~/.ssh",
"chmod 700 ~/.ssh",
Expand All @@ -329,7 +327,7 @@ def get_docker_commands(
"rm -rf /run/sshd && mkdir -p /run/sshd && chown root:root /run/sshd",
"rm -rf /var/empty && mkdir -p /var/empty && chown root:root /var/empty",
# start sshd
"/usr/sbin/sshd -p 10022 -o AllowTcpForwarding=yes -o PermitUserEnvironment=yes",
"/usr/sbin/sshd -p 10022 -o PidFile=none -o PasswordAuthentication=no -o AllowTcpForwarding=yes -o PermitUserEnvironment=yes",
# restore ld.so variables
'if [ -n "$_LD_LIBRARY_PATH" ]; then export LD_LIBRARY_PATH="$_LD_LIBRARY_PATH"; fi',
'if [ -n "$_LD_PRELOAD" ]; then export LD_PRELOAD="$_LD_PRELOAD"; fi',
Expand Down