|
写在前面的话:一般来说,连接Linux服务器 或者说 远程登录Linux,是使用命令行(i.e. ssh)即可,windows连接Linux服务器使用xshell(在xshell里设置转发到xftp可直接登录图形界面)即可,Mac则使用OS自带的终端就可命令行操作。However,如果可以直接在本机上操作图形界面就会方便的多啦,但是经过我好几天的研究……发现这件事情的成功与否只需把握两个字! ----玄学!
所以祝各位连接成功吧!!!
Written in the front: In general, connecting to a Linux server or remote login to Linux, you can use the command line (ie ssh), Windows connection Linux server using xshell (in xshell set to forward to xftp can directly log in to the graphical interface) ;Mac can use the terminal that comes with the OS to command line operations. However, if you can directly operate the graphical interface on your local machine, it will be more convenient.
So I wish you all a successful connection! ! !
1. 打开Mac自带的终端,登录服务器(open terminal in your Mac and log in the LInux server):
ssh -X <username>@<IP address>
举例:ssh -X swj@***.***.***.**
输入密码即可
//注意:如果是要求同一内网,记得挂vpn
2. 下载XQuartz(这是个更加玄学的软件了……真的是醉了),通过这个app可以显示图形界面(Download XQuartz)

标志如上图所示(the icon is shown in the picture),下载地址为(link of download):https://www.xquartz.org
下载完成后你会在launchpad里看不到因为它自己会到“实用工具”里。把它拖出来~
3. 打开XQuartz(选择xterm 也叫终端)(Open it->choose xterm)
登录服务器(输入和终端一样的东西):(Log in the server--input the same things as begore)
ssh -X <username>@<IP address>
举例:ssh -X swj@***.***.***.**
输入密码即可
//注意:如果是要求同一内网,记得挂vpn
具体的如图:

这时很可能会出现一个更加玄学的问题,就是无法输入“.”。。。所以可以参考萌萌的上一个博文(You can see this article if you cannot output "."):XQuartz总是打不出“.”这个符号(MAC版)https://blog.csdn.net/lindasun820/article/details/81293976
然后一通cd,进入到pycharm~~
//完全取决于亲亲您的路径了~
cd download
cd pycharm-community-2018.1
cd bin
sh pycharm.sh
//运行这个pycharm.sh是关键~注意最前面的“sh”不要忘了!!

然后,亲亲会发现,远程的pycharm在本地启动了!!!就跟在Linux上一毛一样,就是分辨率太低了……(Pycharm works in your local machine just as in the Linux server!!!)
开始疯狂操作吧(Let's code)!
退出登录该Linux,在xquartz中输入“exit”即可(TO exit the server, type in "exit" )~
Note: 图中各种乱吗,是因为xquartz不支持中文,所以路径名字,都要改成英文(The various chaos in the picture is because xquartz does not support Chinese, so the path name must be changed to English.)。
Note 2.0: 真的是玄学问题,不行就多试几次,再不行……就明天再试试吧(It’s really a metaphysical problem. If you can’t do it, try it a few times. No more... just try it tomorrow.)~
祝coding愉快哦!(Hope you code happily)~ |