Basic

From AlphaBook
Revision as of 13:20, 28 September 2018 by Admin (talk | contribs)
Jump to: navigation, search

apt-get

  • sudo apt-get update
  • sudo apt-get install net-tools
  • sudo apt-get install vim
  • sudo vim /etc/apt/sources.list

Network

  • List network adaptors
    • ip a
  • sudo vim /etc/netplan/01-network-manager-all.yaml
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
addresses: [192.168.200.55/24]
gateway4: 192.168.200.1
  • sudo netplan apply
  • /etc/resolv.conf
    • name server 114.114.114
    • search corp.alphabook.cn
  • Command 'ifconfig' not found, but can be installed with:
    • sudo apt install net-tools

SSH

  • sudo apt-get install openssh-server
  • sudo vim /etc/ssh/sshd_config
  • sudo service ssh restart

Service

  • sudo systemctl status ssh
  • sudo systemctl start ssh
  • sudo systemctl stop ssh
  • sudo systemctl restart ssh
  • sudo systemctl reload ssh
  • sudo systemctl enable ssh
  • sudo systemctl disable ssh
  • sudo systemctl is-enabled ssh
  • sudo systemctl is-active ssh
  • sudo systemctl show ssh

Process

  • top
  • ps -aux | grep programname | grep -v grep
  • kill -9 pidnumber

Firewall

User and Group

Error: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)

  • sudo rm /var/lib/apt/lists/lock
  • sudo rm /var/cache/apt/archives/lock
  • sudo rm /var/lib/dpkg/lock
  • sudo dpkg --configure -a