Skip to content

Commit

Permalink
Fixed github repo key and ssh restart in WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
stillgreyfox committed Sep 22, 2022
1 parent 9073c66 commit 7fb75b9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ubuntu-wsl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ echo 'Defaults timestamp_timeout=3600' >> /etc/sudoers

CODENAME=$(lsb_release -cs)
cat >> /etc/apt/sources.list << EOF
deb https://cli.github.com/packages $CODENAME main
deb http://ppa.launchpad.net/apt-fast/stable/ubuntu $CODENAME main
EOF
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C99B11DEB97541F0 1EE2FF37CA8DA16B
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1EE2FF37CA8DA16B
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list
apt-get update

export DEBIAN_FRONTEND=noninteractive
Expand All @@ -33,6 +35,12 @@ ChallengeResponseAuthentication no
PermitEmptyPasswords no
PermitRootLogin no
EOF
systemctl reload ssh
# broken because WSL doesn't yet support systemd
# Support was just added, but not yet out of preview
# see here for details:
# https://ubuntu.com/blog/ubuntu-wsl-enable-systemd
#
#systemctl reload ssh
service ssh restart

python -m pip install pip -Uq

0 comments on commit 7fb75b9

Please sign in to comment.