Ubuntu初始化与Centos异同

前端之家收集整理的这篇文章主要介绍了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.f2er.com/ubuntu/355733.html

猜你在找的Ubuntu相关文章