Difference between revisions of "Basic"
From AlphaBook
(→apt-get) |
(→Network) |
||
Line 27: | Line 27: | ||
* sudo netplan apply | * sudo netplan apply | ||
− | * /etc/resolv.conf | + | * sudo vim /etc/resolv.conf |
** name server 114.114.114 | ** name server 114.114.114 | ||
** search corp.alphabook.cn | ** search corp.alphabook.cn | ||
− | |||
− | |||
− | |||
== SSH == | == SSH == |
Revision as of 13:30, 28 September 2018
Contents
apt-get
- Update the Package Index
- sudo apt-get update
- Upgrade Packages
- sudo apt upgrade
- Install a Package
- sudo apt-get install net-tools
- sudo apt-get install vim
- Remove a Package
- sudo apt-get remove net-tools
- Source list
- 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
- ens33:
- sudo netplan apply
- sudo vim /etc/resolv.conf
- name server 114.114.114
- search corp.alphabook.cn
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
- sudo rm /var/lib/apt/lists/lock
- sudo rm /var/cache/apt/archives/lock
- sudo rm /var/lib/dpkg/lock
- sudo dpkg --configure -a