标签 ubuntu 下的文章

安装VMware

使用直链下载然后使用激活码的形式:
https://github.com/201853910/VMwareWorkstation
或者选择使用免费的个人授权:
https://www.cnblogs.com/EthanS/p/18211302

安装ubuntu

下载镜像:

https://ubuntu.com/download/desktop

安装

vmware新建虚拟机,选择使用下载的镜像
然后根据提示输入信息后会自动安装

使用

ping测试

ubuntu打开终端 安装 net-tools

sudo -i #切换到root用户
sudo apt update 
sudo apt install net-tools

安装完成之后运行:

ifconfig

找到网卡(第一串内容)找到inet的标识,后面跟着的就是ip地址
在windows下ping一下这个ip地址,如果可以ping通就表示成功了。

安装 SSH 服务

OpenSSH 是 Ubuntu 默认的 SSH 服务实现,可以使用以下命令安装:

sudo apt install openssh-server -y

安装完之后就可以通过ip来ssh连接虚拟机了

安装docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

设置开机自启

systemctl start docker
systemctl enable docker

配置镜像

https://cmd2.openbase.store/

(ps:太惨了,找个镜像需要找挺久)

安装docker-compose

sudo apt install docker-compose

Ubuntu/Debian 使用ntpdate同步网络时间

之前在一篇博客有提到过玩客云的armbian安装青龙面板

在玩客云上使用青龙面板:

  1. 拉取镜像
docker pull whyour/qinglong:2.10.13
  1. 创建容器
docker run -tid --name qinglong -p 5700:5700 --restart always
whyour/qinglong:2.10.13

然后就可以通过http://ip:5700访问面板了

后来发现用不了,之前在做节点的时候有看到过一个软件ntpdate

这个软件是用来同步网络时间用的,我猜青龙面板用不了是因为时间不同步,后来同步了时间就可以了

1.打开终端输入以下命令安装ntpdate工具。

sudo apt-get install ntpdate

2.再输入命令设置系统时间与网络时间同步。

sudo ntpdate cn.pool.ntp.org

3.最后输入命令将时间更新到硬件上即可。

sudo hwclock --systohc

玩客云在最后一步会报错不过应该不影响

提示

No usable clock interface found.

有解决方法,我懒得搞,放个链接

PCF8523 RTC: hwclock: Cannot access the Hardware Clock via any known method. · Issue #2115 · raspberrypi/linux (github.com)

Debian/Ubuntu 放行端口

安装iptables(通常系统都会自带,如果没有就需要安装)

apt-get update
apt-get install iptables

例如要放行8888端口

iptables -I INPUT -p tcp --dport 8888 -j ACCEPT

然后保存放行规则

iptables-save

设置完就已经放行了指定的端口,但重启后会失效,下面设置持续生效规则;

安装iptables-persistent

apt-get install iptables-persistent

保存规则持续生效

netfilter-persistent save
netfilter-persistent reload

设置完成后指定端口就会持续放行了

Debian / Ubuntu安装v2rayA

v2rayA 的功能依赖于 V2Ray 内核,因此需要安装内核。

安装 V2Ray 内核

V2Ray 的官方脚本

V2Ray 安装参考:https://github.com/v2fly/fhs-install-v2ray

v2rayA 提供的镜像脚本(推荐)

curl -Ls https://mirrors.v2raya.org/go.sh | sudo bash

安装后可以关掉服务,因为 v2rayA 不依赖于该 systemd 服务。

sudo systemctl disable v2ray --now

安装 v2rayA

添加公钥

wget -qO - https://apt.v2raya.org/key/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/v2raya.asc

添加 V2RayA 软件源

echo "deb https://apt.v2raya.org/ v2raya main" | sudo tee /etc/apt/sources.list.d/v2raya.list
sudo apt update

安装 V2RayA

sudo apt install v2raya

开放端口

需要安装 iptables、iptables-persistent

iptables -I INPUT -p tcp --dport 2017 -j ACCEPT
iptables-save
netfilter-persistent save
netfilter-persistent reload
通过ip:2017访问例如: http://localhost:2017

启动 v2rayA / 设置 v2rayA 自动启动

从 1.5 版开始将不再默认为用户启动 v2rayA 及设置开机自动。
  • 启动 v2rayA

    sudo systemctl start v2raya.service
  • 设置开机自动启动

    sudo systemctl enable v2raya.service

重置密码

v2raya --reset-password