夏日幽灵 サマーゴースト (2021)
264 字
1 分钟
Linux服务器初始化指南
Autherized Keys
这个对于需要频繁输入密码却又不想复制粘贴的特别有帮助,例如vscode远程开发
需要先生成自己的ssh-key
如果没有的话, 然后只将公钥放到服务器上
ssh-keygen -t rsa -C "your_email@example.com"
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
sudo nano /etc/ssh/sshd_config
然后在最后面输入
RSAAuthentication yes
PubkeyAuthentication yes
最后执行重启ssh服务
systemctl restart sshd
Oh-my-zsh
或者可选其他终端,已经被oh my zsh
下毒了
sudo apt update && sudo apt upgrade -y
sudo apt install zsh git curl -y
chsh -s /bin/zsh # 切换默认终端为zsh
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
注意如果之前使用bash
一段时间,记得迁移环境变量
# 查看bash配置文件,并手动复制自定义配置
cat ~/.bashrc
# 编辑zsh配置文件,并粘贴自定义配置
nano ~/.zshrc
source ~/.zshrc
配置主题我只用powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
然后在 ~/.zshrc
设置 ZSH_THEME="powerlevel10k/powerlevel10k"
插件的话我只启用三个
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
sudo nano ~/.zshrc
# plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
brew
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install