注意事项,:
export https_proxy=http://192.168.110.10:7897 http_proxy=http://192.168.110.10:7897 all_proxy=socks5://192.168.110.10:7897
export https_proxy= http_proxy= all_proxy=
# 改系统root密码
sudo passwd root
# 切换到系统root账户
su root
配置 zsh
sudo apt install zsh -y
配置 oh-my-zsh
git clone https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
cd ohmyzsh/tools
REMOTE=https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git sh install.sh
配置 zsh-autosuggestions
git clone https://gitee.com/chenweizhen/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
配置 zsh-syntax-highlighting
git clone https://gitee.com/asddfdf/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
配置 .zshrc
vim ~/.zshrc
# 在文件末尾添加以下内容
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
启用 zsh
# 修改默认zsh
chsh -s $(which zsh)
# 启用zsh
source ~/.zshrc
# 查看当前shell
echo $SHELL
安装 vfox
echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list
sudo apt-get update
sudo apt-get install vfox
echo 'eval "$(vfox activate zsh)"' >> ~/.zshrc
配置 vfox
mkdir /usr/local/lib/sdk
sudo chmod -R 777 /usr/local/lib/sdk
vim .version-fox/config.yaml
# 修改sdk路径
#sdk_path: /usr/local/lib/sdk
安装 java 等
vfox search java
vfox search nodejs
vfox search maven
注意:以下命令都需要在本地执行,windows 上安装 ansible 需要先安装 python3
安装 ansible
# 安装ansible
pip3 install ansible ansible-navigator ansible-lint
配置 ansible
# 配置hosts,添加webservers
vim /etc/ansible/hosts
配置 ssh 免密登录
ssh-copy-id root@192.168.110.86
测试 ansible
ansible all -m ping
参考:https://blog.csdn.net/qq_47753695/article/details/140985952
安装 mysql
sudo apt install mysql-server -y
sudo mysql_secure_installation
默认无密码,只能通过本地连接
建立远程访问账号
sudo mysql -u root
SELECT user, host FROM mysql.user WHERE user='root';
-- 建立远程访问账号
CREATE USER 'root'@'%' IDENTIFIED WITH 'mysql_native_password' BY 'Niusen.2024';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
-- 授予本地权限
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'Mall.123456';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;
修改 mysql 配置,允许远程访问
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
bind-address = 0.0.0.0
允许 3306 端口通过 ufw
sudo ufw allow 3306/tcp
sudo ufw reload
sudo service mysql restart
sudo service mysql status
测试连接
在你自己的机器上运行:
mysql -h 192.168.110.86 -u root -p
show databases;
Mall.123456
然后输入 your_password(输入字符不可见,如如后直接回车即可)
安装 redis
sudo apt install redis-server -y
sudo systemctl restart redis-server.service
测试连接
redis-cli
设置密码
# 设置redis密码
sudo vim /etc/redis/redis.conf
# 找到requirepass,设置密码
requirepass your_password
# 保存退出
:wq
设置远程访问
# 设置redis远程访问
sudo vim /etc/redis/redis.conf
# 找到bind,设置为0.0.0.0
bind 0.0.0.0
# 保存退出
:wq
# 允许6379端口通过ufw
sudo ufw allow 6379/tcp
sudo ufw reload
测试连接
在你自己的机器上运行:
redis-cli -h 192.168.110.86 -a your_password