Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux [2019/03/31 14:49]
127.0.0.1 external edit
linux [2019/12/28 23:23] (current)
Line 3: Line 3:
 Linux is a beautiful example of clean engineering. Form follows function and Linux is a beautiful example of clean engineering. Form follows function and
 function follows coherent thoughts. The following is a collection of notes. function follows coherent thoughts. The following is a collection of notes.
 +
 +===== Adding passwordless users =====
 +
 +To add a sudo user that doesn't have a password you have to first add a user with a password, and then delete the password. This activates the password.
 +
 +<code bash>
 +sudo adduser usernameyoulike
 +# give the user any temp password
 +# the following command removes the password
 +sudo passwd -d usernameyoulike
 +# add the user to the sudoers list
 +usermod -aG sudo usernameyoulike
 +</code>
  
 ===== udev ===== ===== udev =====
Line 280: Line 293:
  
  
 +====== Window File Subsystem for Linux ======
 +
 +This thing is awesome! 
 +
 +For setting up ssh keys, xclip doesn't work. Use the following:
 +<code bash>
 +clip.exe < ~/.ssh/id_rsa.pub
 +</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.1554043778.txt.gz
  • Last modified: 2019/03/31 14:49
  • by 127.0.0.1