比较centos与ubuntu的不同

来源:互联网 发布:如何提高口语 知乎 编辑:程序博客网 时间:2024/06/06 01:06
比较centos与ubuntu的不同
1.centos可以使用root登录 ubuntu不能使用root登录
(1)ubuntu开始没有root,只有一个普通用户,需要root时使用sudo,输入密码为普通账号的密码。
(2)新建用户没有sudo权限时需要进/etc/sudores中修改配置文件。我第一次不知道sudo root passwd,进入Grub解决的。
2.网络配置及命令方面
(1)ubuntu的网络配置文件是在/etc/network/interface文件中
DHCP:auto eth0 ;iface eth0 inet dhcp 静态:auto eth0iface;eth0 inet static ;address x.x.x.x ;gateway x.x.x.x ;netmask 255.255.255.0
(2)启动命令 ubuntu是/etc/init.d/networking start|stop|restart service networking start|stop|restart
(3)centos的网络配置文件是/etc/sysconfig/network-scripts/ service network start|stop|restart
(4) 部分查看网络信息相同命令
ip addr //查看IP、掩码、MAC...
ip addr show eth0 //只显示eth0的信息
ip route //查看本机路由表
cat /etc/resolv.conf //查看DNS
hostname //查看主机名
3.自动安装软件
(1)ubuntu使用apt-get;centos使用yum
(2)apt-get install(下载并安装) remove(卸载) upgrade(最新版本) clean(删除所有已下载所有包)update(更新软件包信息)
(3)apt-get配置文件 /etc/sources.list yum /etc/yum.repos.d/