笔记5.1

2.1临时配置IP地址
ifconfig eth0 192.168.1.53/24 #配置临时IP
route add default gw 192.168.1.1 #配置默认路由
echo nameserver 8.8.8.8>/etc/resolv.conf #配置DNS服务器

永久配置IP地址
vim /etc/network/interfaces

iface eth0 inet dhcp #把这一行,前面加#号注释

iface eth0 inet static #配置eth0的固定IP地址
address 192.168.1.53 #配置IP地址
netmask 255.255.255.0 #配置子网掩码
gateway 192.168.1.1 #配置网关

重启服务
1./etc/init.d/networking restart #不记得服务的名字
2.systemctl restart networking #推荐使用

2.2配置sshd服务并使用xshell连接
允许用户登录sshd服务
vim /etc/ssh/sshd_config
修改一下内容第33行和38行
33 PermitRootLogin yes
37 PunkeyAuthentication yes

重启ssh服务
systemctl restart ssh

允许服务开机启动
update-rc.d ssh enable

posted @ 2022-04-30 14:19  redwhale  阅读(34)  评论(0)    收藏  举报