初始化 Linux 服务器
发布于
安全配置
更改 ssh 端口
配置仅密钥登录并禁用 root
shell 配置
安装 zsh
切换默认 shell
chsh -s $(which zsh)配置文件
autoload -Uz compinit && compinitautoload -U colors && colors
PROMPT='%F{green}%n@%m%f:%F{blue}%1~%f %# '
alias ls='ls --color=auto'alias grep='grep --color=auto'
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zshsource /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
zstyle ':completion:*' menu selectbindkey '^I' complete-word
bindkey '^[[A' history-search-backwardbindkey '^[[B' history-search-forward
HISTFILE=~/.zsh_historyHISTSIZE=100SAVEHIST=100
setopt APPEND_HISTORYsetopt INC_APPEND_HISTORYsetopt SHARE_HISTORYsetopt HIST_IGNORE_ALL_DUPS