Amazon AWS 安装 epel

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

允许ping
安全组,入站
添加规则:自定义 ICMP 规则 - IPv4,任何位置

chmod 400 aws.pem
通过其 公有 DNS 连接,默认账户名ec2-user
ssh -i "aws.pem" ec2-user@ec2-52-221-186-41.ap-southeast-1.compute.amazonaws.com

sudo passwd root

su root

vi /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/Packages/e/epel-release-7-11.noarch.rpm
rpm -vih epel-release-7-11.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