CentOS7.5基本操作

1.yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup   备份旧的,修改成国内源。

wget下载源

#163的源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

#阿里云的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

#这个地址由系统决定,此处为centos7 

建立缓存

yum makecache

把服务器的包信息下载到本地缓存起来,配合yum -C search xxx使用,不用上网检索就能查找软件信息。

更新  yum -y update,然后yum makecache生成缓存。

2.添加用户并赋予sudo权限

adduser <username>
passwd <username>
whereis sudoers
ls -l /etc/sudoers
chmod -v u+w /etc/sudoers
vim /etc/sudoers
添加一行 <username> ALL=(ALL)       ALL
ls -l /etc/sudoers
chmod -v u-w /etc/sudoers
ls -l /etc/sudoers

3.禁止root远程ssh登录

sudo vim /etc/ssh/sshd_config
修改 PermitRootLogin 为 no 
重启ssh服务
sudo service sshd restart

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值