Centos 常识

centos6.5: html

1,链接网络:
ifconfig eth0 up 
dhclient eth0 
2
yum groupinstall "X Window System" 
yum groupinstall "Desktop" 
yum groupinstall "Chinese Support" 
yum install firefox
yum install vnc
yum install tigervnc-server
vncserver

网络配置:http://www.jb51.net/os/RedHat/189963.htmlubuntu

修改防火墙:centos

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT

3,阿里云镜像安装:服务器

因minimal只有最小组件,需先下载wget网络

http://mirrors.163.com/centos/6/os/x86_64/Packages/ssh

 curl -O http://mirrors.163.com/centos/6/os/x86_64/Packages/wget-1.12-10.el6.x86_64.rpmcurl

ssh上传服务器tcp

安装wgetide

 rpm -ivh wget-1.12-5.el6.x86_64.rpm

获取阿里云仓库:工具

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
yum clean all
yum makecache

以后就能够用yum install man安装软件,

yum就是ubuntu "apt get"

4,pppoe安装

下载pppoe包:

http://mirrors.163.com/centos/6.7/os/x86_64/Packages/

上传到服务器,安装,[若是是初次安装,此处有三个依赖包]

pppoe登录:http://www.centoscn.com/CentOS/config/2014/0513/2965.html

pppoe启停:

Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/pppoe-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.

----

插一个点:

Ubuntu server adsl拨号,经尝试,在Ubuntu server1404运行ok。

在须要的时候启动ADSL链接,能够在终端中输入:

sudo pon dsl-provider

断开ADSL链接,能够在终端中输入:

sudo poff    

centos 7

7统一默认网络不开:nmtui 命令进入 Network Manager

以下:

选择 Edit a connection 来配置你的网络链接:

 

选择Edit进入DHCP配置:

选择IPv4 CONFIGURATION为Automatic,而且勾选Automatically connect选项。

最后返回命令行,输入:

service network restart

在CentOS 7 minimal中,默认net-tools是没有预先安装的。如今有了网络链接后,就能够使用

yum install net-tools

来安装网络工具,安装完毕以后,诸如ifconfig等命令就都能用了。

yum国内163源安装

1,进入yum源配置目录
cd /etc/yum.repos.d

2,备份系统自带的yum源
mv CentOS-Base.repo CentOS-Base.repo.bk
下载163网易的yum源:

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

3,更新完yum源后,执行下边命令更新yum配置,使操做当即生效
yum makecache

 

防火墙

centos7,使用firewall封装iptables;

查看防火墙状态:

[root@mt ~]# firewall-cmd --state
running

关闭防火墙:

[root@mt ~]# systemctl stop firewalld.service
[root@mt ~]# firewall-cmd --state
not running

禁用防火墙

[root@mt ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@mt ~]#

 

同步时间:

安装时间同步插件:

yum -y install ntp ntpdate

同步时间:

ntpdate cn.pool.ntp.org
22 Mar 17:14:37 ntpdate[23550]: adjust time server 185.255.55.20 offset 0.005426 sec

时间写入磁盘:

hwclock --systohc
相关文章
相关标签/搜索