Skip to content
Thomas Czogalik edited this page Mar 2, 2021 · 4 revisions

Linux

Add new user, allow only ssh login and disable root login

create new user and give sudo rights

sudo adduser userNameHere

  • give sudo rights: usermod -aG sudo username
  • check if successful: sudo whoami should return sudo

Enable ssh key login on remote server

  • on local machine: ssh-keygen -d
  • copy public key: /home/$USERNAME/.ssh/id_rsa.pub
  • add public key on remote server to: /home/$USERNAME/.ssh/authorized_keys
  • edit /etc/ssh/sshd_config
    • enable: AuthorizedKeysFile %h/.ssh/authorized_keys
    • update:
 IgnoreUserKnowHosts yes
 ChallengeResponseAuthentication no
 PasswordAuthentification no
  • only allow user loging:
PasswordAuthentication no
PermitRootLogin no
AllowUsers %USERNAME
  • restart: /etc/init.d/ssh restart

How to Tell What Distro and Version of Linux You Are Running

  • see the Linux distribution name and the version number
cat /etc/issue
  • See the Kernel Version
uname -r

Access usb drive from terminal

  1. Find what the drive is called
lsblk
//or
blkid
//or
fdisk -l
  1. Create a mount point
mkdir /media/usb
  1. Mount/Unmount
//sdb1 is the name found in step 1
mount /dev/sdb1 /media/usb
umount /media/usb
Clone this wiki locally