微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Ubuntu初始化与Centos异同

1.1apt-get

apt-getinstall apache2 #安装apache

设置apt-get本地源

http://www.upantool.com/sense/2014/4679_4.html

1.2Networking

Ubuntu

Centos

vim /etc/hosts

vi /etc/hosts

vim /etc/network/interfaces

auto eth0 #设置自动启动eth0接口

iface eth0 inet static #配置静态IP

address xxx.xxx.xxx.xxx #IP地址

netmask xxx.xxx.xxx.xxx #子网掩码

gateway xxx.xxx.xxx.xxx #网关

auto enp0s3

iface enp0s3 inet dhcp

vi /etc/sysconfig/network-scripts/ifcfg-eth0

sudo vim /etc/resolv.conf

search localdomain

nameserver 172.16.3.4 希望修改成的DNS

nameserver 172.16.3.3 希望修改成的DNS

vi /etc/resolv.conf

/etc/init.d/networking restart

sudo /etc/init.d/resolvconf restart

service networking restart

service network restart

ifconfig

ifconfig

1.3开机自执行

Ubuntu

Centos

vim /etc/rc.d/rc.local

chkconfig --add xxx

chkconfig --level 345 xxx on

1.4首次安装开启root用户

sudopasswd root

su -root

vi/etc/ssh/sshd_config

#PermitRootLoginprohibit-password

PermitRootLogin yes

servicessh restart

1.5查看glibc版本

ldd--version (或getconf GNU_LIBC_VERSION)

原文地址:https://www.jb51.cc/ubuntu/355733.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐