当前位置:首页 > 系统 > Google Cloud Platform

Google Cloud Platform

系统5年前 (2018-10-08)

Google Cloud Platform

Google Cloud Platform免费体验一年,申请后赠送300USD,需要双币信用卡


SecureCRT创建登录秘钥

Google Cloud Platform

打开SecureCRT--tool-->Create Public Key


Google Cloud Platform

秘钥类型为非对称RSA


Google Cloud Platform

秘钥长度为2048


Google Cloud Platform

输入密码和名称,名称为gmail的地址


Google Cloud Platform

下一步


Google Cloud Platform

设置保存路径,Identity是私钥,Identity.pub是公钥


Google Cloud Platform

提示是否全局使用此公钥,可以选是


创建实例

Google Cloud Platform

Google Cloud Platform--Compute Engin--VM实例


Google Cloud Platform

点击创建


Google Cloud Platform

区域改为东京,地区改为asia-northeast1-b,机器类型改为微型共享,启动磁盘改为CentOS 7


Google Cloud Platform

继续回到创建实例的页面,防火墙不需要勾选允许HTTP流量和HTTPS流量


配置VPC网络防火墙

https://console.cloud.google.com/networking/firewalls/ 增加两条规则

一个入站,一个出站,IP地址范围0.0.0.0/0,协议端口为所有

Google Cloud Platform


Google Cloud Platform

返回https://console.cloud.google.com/compute/instances 中修改实例,网络标记中输入刚新建2条规则的名称


Google Cloud Platform

点击安全选项卡,将第一步SecureCRT刚生成的公钥粘贴进去,作为SSH登录的用户名和密码


Google Cloud Platform

网络选项卡中,将内部、外部IP改为固定


Google Cloud Platform

VM实例生成完毕


Google Cloud Platform

使用SecureCRT连接刚生成的VM主机,在Authentication中将Publickey放到首位


开启root登录

sudo -i
mkdir .ssh && chmod 700 .ssh && cp /home/Gmail账号/.ssh/authorized_keys .ssh
vi /etc/ssh/sshd_config
将PermitRootLogin no改为PermitRootLogin yes
systemctl restart sshd.service

Google Cloud Platform


然后使用SecureCRT重新生成秘钥后,控制台中填入新公钥

Google Cloud Platform


客户端中重新引用新公钥,以root登录即可

Google Cloud Platform


手工安装SS

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

Google Cloud Platform


python get-pip.py

Google Cloud Platform


pip install --upgrade pip

Google Cloud Platform


pip install shadowsocks

Google Cloud Platform


增加配置文件

vi /etc/shadowsocks.json
添加
{
  "server": "0.0.0.0",
  "server_port":8400,
  "local_address": "127.0.0.1",
  "local_port": 1080,
  "password": "密码",
  "timeout": 300,
  "method": "aes-256-cfb"
}


创建自启

vi /etc/systemd/system/shadowsocks.service
添加
[Unit]
Description=Shadowsocks

[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json

[Install]
WantedBy=multi-user.target


设置自启

systemctl enable shadowsocks
systemctl start shadowsocks
systemctl status shadowsocks -l

增加swap分区

默认GCE没有交换分区

Google Cloud Platform


查看内存大小

cat /proc/meminfo

Google Cloud Platform


创建交换分区,大小为真实内存的2倍

dd if=/dev/zero of=/swapfile bs=1M count=3481

Google Cloud Platform


格式化swap分区

mkswap -f /swapfile

Google Cloud Platform


修改权限

chmod 0600 /swapfile


挂载swap

swapon /swapfile


验证

free -m

Google Cloud Platform


调优

echo "vm.swappiness=10" >> /etc/sysctl.conf
echo "vm.vfs_cache_pressure = 50" >> /etc/sysctl.conf
sysctl -p

本站所有文章均可随意转载,转载时请保留原文链接及作者。

本文链接:https://www.vos.cn/os/234.html

相关文章

CentOS7安装cacti

CentOS7安装cacti

网上有一种叫cactiez的集成版本,rrd组件一直有问题,版本也太老,于是就想着重新搭建一个环境试试配置环境关闭Selinux vi /etc/selinux/config 将SELI...

Red Hat Enterprise Linux 6.5安装和分区

Red Hat Enterprise Linux 6.5安装和分区

系统镜像名称为rhel-server-6.5-x86_64-dvd.iso安装Install or upgrade an existing system跳过安装源测试检查Next语言English键盘...

CentOS 7转换为OEL 7

CentOS 7转换为OEL 7

参考官方提供的脚本,支持将CentOS 5, 6, 7转换为使用UEK(Unbreakable Enterprise Kernel)的Oracle Enterprise Linux转换系统curl&n...

RHEL6.5修复LVM错误

RHEL6.5修复LVM错误

RHEL6.5启动出现UNEXPECTED INCONSISTENCY RUN fsck MANUALLY,无法正常进入系统输入ROOT密码后然后输入init 0关机虚拟机“电源”--“打开电源时进入...

EVE-NG配置静态固定地址

EVE-NG配置静态固定地址

sudo vi /etc/network/interfaces# The primary network interfaceiface eth0 inet manual ...

RHEL6.5安装Oracle Tuxedo

RHEL6.5安装Oracle Tuxedo

实验环境操作系统:RedHat Enterprise Linux 6.5虚拟机:VMware ESXi 6.5中间件:Oracle Tuxedo 11g R1 11.1.3.0环境配置系统分...