免密登录

  1. 客户端生成公钥、私钥
    1. ssh-keygen
  1. 复制公钥到服务器
    1. cat ~/.ssh/id_rsa.pub
  1. 服务器生成~/.ssh/authorized_keys 文件并粘贴客户端公钥
    1. ssh localhost vim ~/.ssh/authorized_keys
退出重新登录服务器测试

用户设置

创建sudo用户

# 创建用户 busyhe sudo useradd busyhe # 修改密码 sudo passwd busyhe # 添加到 sudo 用户组 sudo usermod -aG wheel busyhe # 切换到新用户添加免密登录 su busyhe # 粘贴公钥 vim ~/.ssh/authorized_keys # 赋予权限 chmod 600 ~/.ssh/authorized_keys
sudo yum update && sudo yum -y install zsh zsh --version # install

Neovim

sudo yum install neovim

安装前端环境

NodeJS

# install nvm (没反应可以多试几次) wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash # install nodejs nvm install --lts # 查看node版本 node -v

GIt

sudo yum install git git --version

pm2

npm install -g pm2 # 初始化 pm2 pnpm init
 

pnpm

npm install -g pnpm

Zsh

sudo yum update && sudo yum -y install zsh zsh --version chsh -s $(which zsh)
如果没有自动生成 ~/.zshrc 通过拷贝官方存储库创建文件
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

plugins

# 高亮插件 zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting # 自动补全 zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions # 配置插件 vim ~/.zshrc # 找到 plugins = () 填入 plugins=(其他的插件 zsh-syntax-highlighting zsh-autosuggestions) # 使生效 . ~/.zshrc

theme

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
badge