ubuntu_setup_env.sh文件:
- #!/bin/bash
- set -e
-
- SSHD_LISTEN_ADDRESS=127.0.0.1
-
- SSHD_PORT=2222
- SSHD_FILE=/etc/ssh/sshd_config
- SUDOERS_FILE=/etc/sudoers
-
- # 0. update package lists
- sudo apt-get update
-
- # 0.1. reinstall sshd (workaround for initial version of WSL)
- sudo apt remove -y --purge openssh-server
- sudo apt install -y openssh-server
-
- # 0.2. install basic dependencies
- sudo apt install -y cmake ninja-build gcc clang gdb valgrind build-essential
-
- # 1.1. configure sshd
- sudo cp $SSHD_FILE ${SSHD_FILE}.`date '+%Y-%m-%d_%H-%M-%S'`.back
- sudo sed -i '/^Port/ d' $SSHD_FILE
- sudo sed -i '/^ListenAddress/ d' $SSHD_FILE
- sudo sed -i '/^UsePrivilegeSeparation/ d' $SSHD_FILE
- sudo sed -i '/^PermitRootLogin/ d' $SSHD_FILE
- sudo sed -i '/^PasswordAuthentication/ d' $SSHD_FILE
- echo "# configured by CLion" | sudo tee -a $SSHD_FILE
- echo "ListenAddress