Skip to content

Commit

Permalink
Fix commnad to enable root ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Nov 7, 2019
1 parent 463aaa1 commit 7ef0a50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions IM/connectors/Docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,7 @@ def _generate_create_svc_request_data(self, image_name, outports, vm, ssh_port,
command += " ; "
command += "mkdir /var/run/sshd"
command += " ; "
command += " sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config "
command += " ; "
command += "sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config"
command += " ; "
command += "sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config"
command += "sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config"
command += " ; "
command += "rm -f /etc/ssh/ssh_host_rsa_key*"
command += " ; "
Expand Down
4 changes: 1 addition & 3 deletions IM/connectors/Kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ def _generate_pod_data(self, apiVersion, namespace, name, outports, system, ssh_
command += " ; "
command += "mkdir /var/run/sshd"
command += " ; "
command += "sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config"
command += " ; "
command += "sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config"
command += "sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config"
command += " ; "
command += "ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''"
command += " ; "
Expand Down

0 comments on commit 7ef0a50

Please sign in to comment.