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)

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...