centos的基础环境

1.ssh私钥登录配置

将本机电脑.ssh目录下的id_rsa.pub

拷贝到服务器的.ssh目录的authorized_kyes文件里面

如果没有.ssh目录,创建一个.ssh目录,和创建authorized_kyes文件

修改authorized_keys文件的权限为400

如果没有id_rsa.pub的话,使用ssh-keygen命令生成秘钥对

ssh-keygen -t rsa

2.python环境

选择安装anaconda的环境 anaconda已经集成了很多我们需要的python的包,包括科学计算numpy等。

anaconda

下载页面:https://www.anaconda.com/distribution/

安装python3.7

64-Bit (x86) Installer (654 MB)

安装python2.7

64-Bit (x86) Installer (630 MB)

使用wget命令下载安装包,然后执行sh *.sh即可

3.yum源

这里选择阿里云的yum源

备份yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下载yum源

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

安装常用工具

yum install vim

yum install wget

yum install net-tools

yum install git

4.安装开发依赖

yum groupinstall "Development tools"

yum install zlib-devel 

yum install bzip2-devel 

yum install openssl-devel 

yum install ncurses-devel 

yum install sqlite-devel

5.安装nginx

安装nginx rpm包

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx

systemctl start nginx

6.科学上网

shadowsocks

pip install shadowsocks

ssserver -c ss.config -d start

ss.config example:

{

​ “server”:“ip”,

​ “server_port”: port,

​ “local_port”:

​ “password”:

​ “timeout”:600,

​ “method”:“aes-256-cfb”

}