amazon linux 安装

10 篇文章 0 订阅

一、docker

  • 安装dockeryum install docker -y
  • 启动dockerservice docker restart
  • 开机自启动systemctl enable docker
  • 配置全局docker快捷方式(无需再使用sudo)
# 查看状态
sudo service docker status
# ec2-user为当前账户登录名
sudo usermod -a -G docker ec2-user
# 这句不用加sudo
newgrp docker 
  • 安装docker-compose
# 下载docker-compose包并移动至/usr/local/bin/
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
# 执行权限
sudo chmod +x /usr/local/bin/docker-compose
# 软链
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

二、mysql

##、当yum安装失败时
##、配置mysql yum库并安装

  1. 下载mysql5.7的yum源
    wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
  2. 安装mysql5.7的yum源
    yum localinstall mysql57-community-release-el6-11.noarch.rpm
  3. 查看yum是不是多了两个仓库,mysql-community-source.repo,mysql-community.repo
    在这里插入图片描述
  4. 移除原先安装的mysql服务
    yum remove mysql55 mysql55-common mysql55-libs mysql55-server
  5. 开始安装yum install mysql-community-server -y 或 yum install mysql-server -y
    5*如果出现GPG check FAILED,追加参数–nogpgcheck绕过GPG验证
    在这里插入图片描述
  6. 启动sql服务service mysqld restart
  7. 另一系统命令查看启动状态systemctl status mysqld
  8. 获取mysql默认密码如用mysql -uroot -p是无需密码的,因为mysql会默认读取提供的密码
    cat /var/log/mysqld.log | grep "A temporary password"
    在这里插入图片描述
  9. 修改mysql密码mysql_secure_installation
    在这里插入图片描述
  10. 再提供一个修改默认密码方式(9、10二选一):进入数据库update变更并重启服务
mysql>update mysql.user set authentication_string=password("yourpassword") where user="root" and Host="localhost”;
mysql>flush privileges;
mysql>quit;
service mysqld restart
  1. 进入数据库mysql -u root -p
    在这里插入图片描述

三、nginx

yum install -y nginx

四、redis

yum install -y redis6

五、conda

  • 安装
wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh
sh Anaconda3-5.3.0-Linux-x86_64.sh
# 按场景一直回车Enter|yes
  • 查看cd /home/$hostname/是不是有anaconda3文件夹,记录此路径并追加到~/.bashrc
  • 环境变量vim ~/.bashrc,文件末尾添加export PATH=$PATH:/home/$hostname/anaconda3/bin
  • 生效source ~/.bashrc

六、sshguard

  • 配置epel源curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  • 配置Centos-7源curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  • 查看目录ls /etc/yum.repos.d/下是不是多了两个repo仓库epel.repo、CentOS-Base.repo
  • 安装yum install sshguard -y
  • 准备sshguard启动配置文件cp /usr/share/doc/sshguard-2.4.2/examples/sshguard.conf.sample /etc/sshguard.conf
  • 编辑修改配置文件vim /etc/sshguard.conf
BACKEND="/usr/libexec/sshguard/sshg-fw-firewalld"  # 需要安装防火墙firewalld
FILES="/var/log/secure"                            # touch创建文件secure
BLACKLIST_FILE=90:/etc/sshguard.blacklist
WHITELIST_FILE=/etc/sshguard.whitelist
  • 自启动服务systemctl enable sshguard
  • 启动systemctl start sshguard并查看状态systemctl status sshguard
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学无止境gwx

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值