查看IP
ip a
设置固定IP
sudo nano /etc/NetworkManager/NetworkManager.conf
- Change the value of managed from
false
totrue
- Restart Linux
Run sudo nano /etc/network/interfaces
to open the file. Then add the following lines:
auto eth0 #表示让网卡开机自动挂载eth0
iface eth0 inet static
address 172.26.20.2
gateway 172.26.1.1
netmask 255.255.0.0
dns-nameservers 47.88.13.89 8.8.8.8
设置DNS
sudo vim /etc/resolvconf/resolv.conf.d/base
Then put your nameserver list in like so:
nameserver 8.8.8.8
nameserver 8.8.4.4
Finally update resolvconf:
sudo resolvconf -u
更新
sudo apt-get update
安装SSH
sudo apt-get install openssh-server -y