1 SSH设置
modify ~/.ssh/config
1.1 SSH多个连接共享
ControlPersist 可以设置长连接的时间,即使所有的窗口退出, 连接仍保持.
ControlPersist 4h
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
1.2 SSH远程GUI
ForwardX11 yes
X11Forwarding yes
1.3 本地操作远程文件
sshfs user@ip:/path/to/remote_dir local_dir
1.4 主机别名
User指定默认用那个用户名进行操作
Host alias_name
HostName real_host
User dc2-user
1.5 xauth警告
- 生成文件, 如果有备份删除:
touch ~/.Xauthority
- X11 display over ssh:
xauth generate :0 . trusted
- (不需要)生成本地主机的Key:
xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom)
2 完整的配置
KexAlgorithms=+diffie-hellman-group1-sha1
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 6h
GSSAPIAuthentication no
XAuthLocation /usr/bin/xauth
Host *
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
Host cauchy
HostName xxx.xxx.xxx.xxx
User xxx-user
# mount: sshfs cauchy:work/code code
Host github.com
HostName github.com
PreferredAuthentications publickey
User git
IdentityFile /home/lidong/.ssh/id_rsa_qrsblog
3 安装中文字体
sudo apt install -y --no-install-recommends fonts-wqy-microhei
sudo apt install -y --no-install-recommends ttf-wqy-zenhei