Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
linux [2019/12/28 18:59]
paul [Window File Subsystem for Linux]
linux [2019/12/28 23:23] (current)
Line 301: Line 301:
 clip.exe < ~/.ssh/id_rsa.pub clip.exe < ~/.ssh/id_rsa.pub
 </code> </code>
 +
 +===== SSH Access =====
 +
 +For setting up external ssh access I did the following:
 +
 +Reinstall openssh for some reason:
 +<code bash>
 +sudo apt-get purge openssh-server
 +sudo apt-get install openssh-server
 +</code>
 +
 +From an elevated powershell I ran this to change the port to 2222 to not
 +interfere with any windows services:
 +<code bash>
 +New-NetFirewallRule -DisplayName "Allow Inbound Port 2222" -Direction Inbound -LocalPort 2222 -Protocol TCP -Action Allow
 +</code>
 +
 +I added the following to sshd_config:
 +
 +<code bash>
 +Port 2222
 +PermitRootLogin no
 +AllowUsers paul
 +</code>
 +
 +I created an authorized hosts file and imported the keys.
 +
 +I tested the connection by running this on the server:
 +<code bash>
 +sudo service ssh stop
 +sudo /usr/sbin/sshd -d
 +</code>
 +
 +Then on the client I ran a debug version of an ssh server to see if I was
 +receiving incoming connections.
 +<code bash>
 +ssh name@server -p 2222
 +</code>
 +
 +I then monitored the server and make sure I could see the connection. The debug
 +client quit out cause it didn't have correct paths to the keys, but the test was
 +a success cause it validated the port pass through. I then restarted the regular
 +service like this:
 +
 +<code bash>
 +sudo service ssh start
 +</code>
 +
  • linux.1577559563.txt.gz
  • Last modified: 2019/12/28 18:59
  • by paul