sudo nano /etc/netplan/01-netcfg.yaml
1.Ubuntu设置静态IP
修改/etc/netplan/01-netcfg.yaml 或其它在/etc/netplan目录下的文件:
sudo vim /etc/netplan/01-netcfg.yaml
修改为:
#root@master:/etc/netplan# cat 50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
eth0:
dhcp4: no
addresses:
- 172.22.94.87/20
routes:
- to: default
via: 172.22.80.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
version: 2
最后运行:
sudo netplan apply
2.Linux设置允许root ssh登陆
ubuntu下载安装ssh:
sudo apt install openssh-server
修改文件:
sudo vim /etc/sshd/ssh_config
添加下面代码:
PermitRootLogin yes
修改root密码:
sudo passwd root
重启ssh:
sudo systemctl restart sshd
其它命令
查看tcp拥塞窗口 cwnd:
ss -lni |grep cwnd