Amazon AWS 安装 epel

注意:不要在AWS上安装 iptables-service,否则会导致无法恢复的网络异常

sudo passwd root

su root

vim /etc/ssh/sshd_config
PasswordAuthentication yes
PermitRootLogin no

sudo systemctl restart sshd

passwd ec2-user

vi /etc/sysconfig/selinux
SELINUX=disabled

添加新用户:
adduser username
passwd username
Login as new username:
su root
userdel -r ec2-user

yum-config-manager –enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

yum install wget
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
rpm -vih epel-release-7-9.noarch.rpm

vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/7/$basearch/
gpgcheck=0
enabled=1

vi /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc