suse 12最小化安装后基本配置命令、配置网卡ip/dns/网关/hostname、开启root的ssh、关闭防火墙

Linux 266℃

1、查看发行版本、内核版本

cat /etc/issue
uname -a

2、配置网卡IP地址

cd /etc/sysconfig/network/
vim ifcfg-eth0
BOOTPROTO='static'           # dhcp(自动获取)、static(静态)
IPADDR='192.168.10.150/24'   # IP地址/掩码
STARTMODE='auto'             # 开机启动网卡

3、配置网关

vim routes 
default 192.168.10.2 - -

4、配置DNS

vim /etc/resolv.conf
nameserver 192.168.10.2

5、重启网卡

systemctl restart network
ping www.baidu.com

6、修改hostname

hostnamectl set-hostname suse-linux --static

7、关闭防火墙

#suse里面的防火墙名称是SuSEfirewall2,和centos不一样
systemctl disable SuSEfirewall2 --now
systemctl status SuSEfirewall2

8、开启允许root的ssh

vim /etc/ssh/sshd_config 
PermitRootLogin yes            # 允许root用户登录
PasswordAuthentication yes     # 开启密码验证
systemctl restart sshd

9、总结
初次使用suse很不习惯,有些命令和centos不太一样:
1、suse的软件安装方式使用的是zypper,而centos是yum
2、suse的静态网卡配置也和centos不一样(当时配的我有点蒙圈)
3、suse的firewalld服务器名称和centos不一样
4、suse默认关闭selinux(这点很赞)
5、suse有的时候命令行会有小bug,会导致命令不存在(多敲几次回车就好了,还没碰到)
6、suse终端默认显示的红色挺好醒目

转载请注明:零五宝典 » suse 12最小化安装后基本配置命令、配置网卡ip/dns/网关/hostname、开启root的ssh、关闭防火墙