Linux下有很多终端,大多是需要X支持,个人比较喜欢Terminator。如果linux server上没有开启X11,可以通过在SSH上开启X11 forwarding的方式在本地打开远程终端。
- 本地安装VcXsrv
安装后默认开启配置,可以手工设置后保存config文件到AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
来让VcXsrc开机时自动运行,也可以给vcxsrv.exe创建桌面快捷方式,然后在目标加入下面的运行参数来手工启动。具体配置可以参考这里。
"C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto
- 配置SSH
修改完配置要重启SSH service
sudo vim /etc/ssh/sshd_config
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
AllowStreamLocalForwarding yes
#PermitTTY yes
- 安装terminator和ohmyzsh
sudo apt-get update
sudo apt-get install terminator
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
在putty里配置X11 forwarding
根据VcXsrv的配置来设置X display location, 默认下就是127.0.0.1:0.0
如果懒得每次putty登陆都输账户密码的话,可以顺便设置下authentication
-
Enjoy it....