对于有远程需要的同学们来讲,需要一个稳定,好用,最好还免费的远程工具以便在Windows端管理自己的linux系统怎么办?
MobaXterm,可以解决你的烦恼
MobaXterm,免费,而且功能强大
ssh/文件传输,一键执行命令,VNC等等功能,今天我们先来讨论下基础的 ssh以及文件传输功能,VNC
1.首先在windows下下载MobaXterm软件
下载地址:https://mobaxterm.mobatek.net/download.html
下载后得到一个这样的程序
这个可以直接放到桌面去双击运行,免安装,或者右键发送快捷方式到桌面,都可以
2.打开后的界面:
注意,在你程式放置的路径下会生成一份MobaXterm.ini的文件,这个是你的配置档,当你连接客户端后,他会保存下来,下次就不用再重复录入某些讯息了,如果删掉,就清空了记录。
然后我们点击左上角 Session – ssh – 在 Remote host*栏位填入需要ssh的电脑的IP地址,然后点击OK
然后你会看到一个这样的界面,选择Accpet就好
然后可以看到 login as:
正常输入 登录的用户名(用户名为Linux端电脑的用户名)
然后会让你输入password,就正常输入linux端的密码就可以了
得到这样一个弹窗,点yes,把密码保存下来,以后就不用输密码了。也可以点No,不保存,每次登录自己再输一下密码,看个人需要
如果点Yes的话,会有一个弹窗,这个是moba这边的密码,随意输一个你能记住的密码就行
然后就成功登录到了linux端:
可以看到左边有很多文件夹,这些都是linux系统端的文件,我们可以直接从windows端拖文件到已ssh连接的Linux端,也可以从linux端拖动文件到Windows端,非常好用
同时我们也可以直接编辑linux端的文件:
找到我们需要编辑的文件,右键,选择Open With
然后你就可以用windows上已经安装的软件进行文件编辑啦,编辑完成后记得保存
保存的时候会有弹窗:
选择前三个都行,我比较喜欢用Aotu save,免得每次都来问
随后你可以看到左边已经保留了记录,以后就可以直接点击左边的记录连接,而不用按照之前的步骤进行了,省掉了繁琐的步骤
进阶,VNC连接:
我们上面ssh只能够做到命令窗口,对一些需要图形化界面的小伙伴比较不友好,Moba提供了VNC功能,可以远程操控桌面
首先需要在linux系统端安装一个vnc,方法如下
root@unassigned:~# apt-get install tightvncserver
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libjpeg-turbo8 libjpeg8 libxcursor1 x11-xserver-utils xfonts-base xfonts-encodings xfonts-utils
Suggested packages:
tightvnc-java nickle cairo-5c xorg-docs-core
The following NEW packages will be installed:
libjpeg-turbo8 libjpeg8 libxcursor1 tightvncserver x11-xserver-utils xfonts-base xfonts-encodings xfonts-utils
0 upgraded, 8 newly installed, 0 to remove and 1 not upgraded.
Need to get 7526 kB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.aliyun.com/ubuntu bionic-security/main amd64 libjpeg-turbo8 amd64 1.5.2-0ubuntu5.18.04.6 [111 kB]
Get:2 https://mirrors.aliyun.com/ubuntu bionic/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2194 B]
Get:3 https://mirrors.aliyun.com/ubuntu bionic/main amd64 libxcursor1 amd64 1:1.1.15-1 [19.8 kB]
Get:4 https://mirrors.aliyun.com/ubuntu bionic/universe amd64 tightvncserver amd64 1.3.10-0ubuntu4 [655 kB]
Get:5 https://mirrors.aliyun.com/ubuntu bionic/main amd64 x11-xserver-utils amd64 7.7+7build1 [159 kB]
Get:6 https://mirrors.aliyun.com/ubuntu bionic/main amd64 xfonts-encodings all 1:1.0.4-2 [573 kB]
Get:7 https://mirrors.aliyun.com/ubuntu bionic/main amd64 xfonts-utils amd64 1:7.7+6 [91.5 kB]
Get:8 https://mirrors.aliyun.com/ubuntu bionic/main amd64 xfonts-base all 1:1.0.4+nmu1 [5914 kB]
Fetched 7526 kB in 3s (2294 kB/s)
Selecting previously unselected package libjpeg-turbo8:amd64.
(Reading database ... 76762 files and directories currently installed.)
Preparing to unpack .../0-libjpeg-turbo8_1.5.2-0ubuntu5.18.04.6_amd64.deb ...
Unpacking libjpeg-turbo8:amd64 (1.5.2-0ubuntu5.18.04.6) ...
Selecting previously unselected package libjpeg8:amd64.
Preparing to unpack .../1-libjpeg8_8c-2ubuntu8_amd64.deb ...
Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
Selecting previously unselected package libxcursor1:amd64.
Preparing to unpack .../2-libxcursor1_1%3a1.1.15-1_amd64.deb ...
Unpacking libxcursor1:amd64 (1:1.1.15-1) ...
Selecting previously unselected package tightvncserver.
Preparing to unpack .../3-tightvncserver_1.3.10-0ubuntu4_amd64.deb ...
Unpacking tightvncserver (1.3.10-0ubuntu4) ...
Selecting previously unselected package x11-xserver-utils.
Preparing to unpack .../4-x11-xserver-utils_7.7+7build1_amd64.deb ...
Unpacking x11-xserver-utils (7.7+7build1) ...
Selecting previously unselected package xfonts-encodings.
Preparing to unpack .../5-xfonts-encodings_1%3a1.0.4-2_all.deb ...
Unpacking xfonts-encodings (1:1.0.4-2) ...
Selecting previously unselected package xfonts-utils.
Preparing to unpack .../6-xfonts-utils_1%3a7.7+6_amd64.deb ...
Unpacking xfonts-utils (1:7.7+6) ...
Selecting previously unselected package xfonts-base.
Preparing to unpack .../7-xfonts-base_1%3a1.0.4+nmu1_all.deb ...
Unpacking xfonts-base (1:1.0.4+nmu1) ...
Setting up libjpeg-turbo8:amd64 (1.5.2-0ubuntu5.18.04.6) ...
Setting up xfonts-encodings (1:1.0.4-2) ...
Setting up libxcursor1:amd64 (1:1.1.15-1) ...
Setting up x11-xserver-utils (7.7+7build1) ...
Setting up libjpeg8:amd64 (8c-2ubuntu8) ...
Setting up xfonts-utils (1:7.7+6) ...
Setting up tightvncserver (1.3.10-0ubuntu4) ...
update-alternatives: using /usr/bin/tightvncserver to provide /usr/bin/vncserver (vncserver) in auto mode
update-alternatives: using /usr/bin/Xtightvnc to provide /usr/bin/Xvnc (Xvnc) in auto mode
update-alternatives: using /usr/bin/tightvncpasswd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode
Setting up xfonts-base (1:1.0.4+nmu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
root@unassigned:~# vncserver :1
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
New 'X' desktop is unassigned:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/unassigned:1.log
root@unassigned:~#
我这里是ubuntu系统,安装命令是:apt-get install tightvncserver
然后启用vnc vncserver :1
,然后输入登录密码
启用完成后,回到Windows moba端:
按照如上顺序进行登录,注意,IP后面有一个 :1
这个是VNC的端口,不要忘记,我们在Ubuntu端创建了一个VNC:1,所以在这边我们才可以连接
,随后输入密码后,就可以看到桌面啦
我这里因为原本的系统就是命令行的,所以才是这样,如果linux系统本身有图形化界面,就会是图形化界面