mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
Translated
This commit is contained in:
parent
c79eebc372
commit
dbdf0e6c50
@ -1,153 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zhs852)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How To Install And Use PuTTY On Linux)
|
||||
[#]: via: (https://www.ostechnix.com/how-to-install-and-use-putty-on-linux/)
|
||||
[#]: author: (SK https://www.ostechnix.com/author/sk/)
|
||||
|
||||
How To Install And Use PuTTY On Linux
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2019/02/putty-720x340.png)
|
||||
|
||||
**PuTTY** is a free and open source GUI client that supports wide range of protocols including SSH, Telnet, Rlogin and serial for Windows and Unix-like operating systems. Generally, Windows admins use PuTTY as a SSH and telnet client to access the remote Linux servers from their local Windows systems. However, PuTTY is not limited to Windows. It is also popular among Linux users as well. This guide explains how to install PuTTY on Linux and how to access and manage the remote Linux servers using PuTTY.
|
||||
|
||||
### Install PuTTY on Linux
|
||||
|
||||
PuTTY is available in the official repositories of most Linux distributions. For instance, you can install PuTTY on Arch Linux and its variants using the following command:
|
||||
|
||||
```
|
||||
$ sudo pacman -S putty
|
||||
```
|
||||
|
||||
On Debian, Ubuntu, Linux Mint:
|
||||
|
||||
```
|
||||
$ sudo apt install putty
|
||||
```
|
||||
|
||||
### How to use PuTTY to access remote Linux systems
|
||||
|
||||
Once PuTTY is installed, launch it from the menu or from your application launcher. Alternatively, you can launch it from the Terminal by running the following command:
|
||||
|
||||
```
|
||||
$ putty
|
||||
```
|
||||
|
||||
This is how PuTTY default interface looks like.
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2019/02/putty-default-interface.png)
|
||||
|
||||
As you can see, most of the options are self-explanatory. On the left pane of the PuTTY interface, you can do/edit/modify various configurations such as,
|
||||
|
||||
1. PuTTY session logging,
|
||||
2. Options for controlling the terminal emulation, control and change effects of keys,
|
||||
3. Control terminal bell sounds,
|
||||
4. Enable/disable Terminal advanced features,
|
||||
5. Set the size of PuTTY window,
|
||||
6. Control the scrollback in PuTTY window (Default is 2000 lines),
|
||||
7. Change appearance of PuTTY window and cursor,
|
||||
8. Adjust windows border,
|
||||
9. Change fonts for texts in PuTTY window,
|
||||
10. Save login details,
|
||||
11. Set proxy details,
|
||||
12. Options to control various protocols such as SSH, Telnet, Rlogin, Serial etc.
|
||||
13. And more.
|
||||
|
||||
|
||||
|
||||
All options are categorized under a distinct name for ease of understanding.
|
||||
|
||||
### Access a remote Linux server using PuTTY
|
||||
|
||||
Click on the **Session** tab on the left pane. Enter the hostname (or IP address) of your remote system you want to connect to. Next choose the connection type, for example Telnet, Rlogin, SSH etc. The default port number will be automatically selected depending upon the connection type you choose. For example if you choose SSH, port number 22 will be selected. For Telnet, port number 23 will be selected and so on. If you have changed the default port number, don’t forget to mention it in the **Port** section. I am going to access my remote via SSH, hence I choose SSH connection type. After entering the Hostname or IP address of the system, click **Open**.
|
||||
|
||||
![](http://www.ostechnix.com/wp-content/uploads/2019/02/putty-1.png)
|
||||
|
||||
If this is the first time you have connected to this remote system, PuTTY will display a security alert dialog box that asks whether you trust the host you are connecting to. Click **Accept** to add the remote system’s host key to the PuTTY’s cache:
|
||||
|
||||
![][2]
|
||||
|
||||
Next enter your remote system’s user name and password. Congratulations! You’ve successfully connected to your remote system via SSH using PuTTY.
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2019/02/putty-3.png)
|
||||
|
||||
**Access remote systems configured with key-based authentication**
|
||||
|
||||
Some Linux administrators might have configured their remote servers with key-based authentication. For example, when accessing AMS instances from PuTTY, you need to specify the key file’s location. PuTTY supports public key authentication and uses its own key format ( **.ppk** files).
|
||||
|
||||
Enter the hostname or IP address in the Session section. Next, In the **Category** pane, expand **Connection** , expand **SSH** , and then choose **Auth**. Browse the location of the **.ppk** key file and click **Open**.
|
||||
|
||||
![][3]
|
||||
|
||||
Click Accept to add the host key if it is the first time you are connecting to the remote system. Finally, enter the remote system’s passphrase (if the key is protected with a passphrase while generating it) to connect.
|
||||
|
||||
**Save PuTTY sessions**
|
||||
|
||||
Sometimes, you want to connect to the remote system multiple times. If so, you can save the session and load it whenever you want without having to type the hostname or ip address, port number every time.
|
||||
|
||||
Enter the hostname (or IP address) and provide a session name and click **Save**. If you have key file, make sure you have already given the location before hitting the Save button.
|
||||
|
||||
![][4]
|
||||
|
||||
Now, choose session name under the **Saved sessions** tab and click **Load** and click **Open** to launch it.
|
||||
|
||||
**Transferring files to remote systems using the PuTTY Secure Copy Client (pscp)
|
||||
**
|
||||
|
||||
Usually, the Linux users and admins use **‘scp’** command line tool to transfer files from local Linux system to the remote Linux servers. PuTTY does have a dedicated client named **PuTTY Secure Copy Clinet** ( **PSCP** in short) to do this job. If you’re using windows os in your local system, you may need this tool to transfer files from local system to remote systems. PSCP can be used in both Linux and Windows systems.
|
||||
|
||||
The following command will copy **file.txt** to my remote Ubuntu system from Arch Linux.
|
||||
|
||||
```
|
||||
pscp -i test.ppk file.txt sk@192.168.225.22:/home/sk/
|
||||
```
|
||||
|
||||
Here,
|
||||
|
||||
* **-i test.ppk** : Key file to access remote system,
|
||||
* **file.txt** : file to be copied to remote system,
|
||||
* **sk@192.168.225.22** : username and ip address of remote system,
|
||||
* **/home/sk/** : Destination path.
|
||||
|
||||
|
||||
|
||||
To copy a directory. use **-r** (recursive) option like below:
|
||||
|
||||
```
|
||||
pscp -i test.ppk -r dir/ sk@192.168.225.22:/home/sk/
|
||||
```
|
||||
|
||||
To transfer files from Windows to remote Linux server using pscp, run the following command from command prompt:
|
||||
|
||||
```
|
||||
pscp -i test.ppk c:\documents\file.txt.txt sk@192.168.225.22:/home/sk/
|
||||
```
|
||||
|
||||
You know now what is PuTTY, how to install and use it to access remote systems. Also, you have learned how to transfer files to the remote systems from the local system using pscp program.
|
||||
|
||||
And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned!
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-install-and-use-putty-on-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: http://www.ostechnix.com/wp-content/uploads/2019/02/putty-2.png
|
||||
[3]: http://www.ostechnix.com/wp-content/uploads/2019/02/putty-4.png
|
||||
[4]: http://www.ostechnix.com/wp-content/uploads/2019/02/putty-5.png
|
@ -0,0 +1,150 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zhs852)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How To Install And Use PuTTY On Linux)
|
||||
[#]: via: (https://www.ostechnix.com/how-to-install-and-use-putty-on-linux/)
|
||||
[#]: author: (SK https://www.ostechnix.com/author/sk/)
|
||||
|
||||
在 Linux 中安装并使用 PuTTY
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2019/02/putty-720x340.png)
|
||||
|
||||
PuTTY 是一个免费、开源且支持包括 SSH、Telnet 和 Rlogin 在内的多种协议的 GUI 客户端。一般来说,Windows 管理员们会把 PuTTY 当成 SSH 或 Telnet 客户端来在本地 Windows 系统和远程 Linux 服务器之间建立连接。不过,PuTTY 可不是 Windows 的独占软件。它在 Linux 用户之中也是很流行的。本篇文章将会告诉你如何在 Linux 中安装并使用 PuTTY。
|
||||
|
||||
### 在 Linux 中安装 PuTTY
|
||||
|
||||
PuTTY 已经包含在了许多 Linux 发行版的官方源中。举个例子,在 Arch Linux 中,我们可以通过这个命令安装 PuTTY:
|
||||
|
||||
```shell
|
||||
$ sudo pacman -S putty
|
||||
```
|
||||
|
||||
在 Debian、Ubuntu 或是 Linux Mint 中安装它:
|
||||
|
||||
```shell
|
||||
$ sudo apt install putty
|
||||
```
|
||||
|
||||
### 使用 PuTTY 访问远程 Linux 服务器
|
||||
|
||||
在安装完 PuTTY 之后,你可以在菜单或启动器中打开它。如果你想用终端打开它,也是可以的:
|
||||
|
||||
```shell
|
||||
$ putty
|
||||
```
|
||||
|
||||
PuTTY 的默认界面长这个样子:
|
||||
|
||||
![PuTTY 默认界面](https://www.ostechnix.com/wp-content/uploads/2019/02/putty-default-interface.png)
|
||||
|
||||
如你所见,许多选项都配上了说明。在左侧面板中,你可以配置许多项目,比如:
|
||||
|
||||
1. 修改 PuTTY 登录会话选项;
|
||||
2. 修改终端模拟器控制选项,控制各个按键的功能;
|
||||
3. 控制终端响铃的声音;
|
||||
4. 启用/禁用终端的高级功能;
|
||||
5. 设定 PuTTY 窗口大小;
|
||||
6. 控制命令回滚长度(默认是 2000 行);
|
||||
7. 修改 PuTTY 窗口或光标的外观;
|
||||
8. 调整窗口边缘;
|
||||
9. 调整字体;
|
||||
10. 保存登录信息;
|
||||
11. 设置代理;
|
||||
12. 修改各协议的控制选项;
|
||||
13. 以及更多。
|
||||
|
||||
所有选项基本都有注释,相信你理解起来不难。
|
||||
|
||||
### 使用 PuTTY 访问远程 Linux 服务器
|
||||
|
||||
请在左侧面板点击 **会话** 选项卡,输入远程主机名(或 IP 地址)。然后,请选择连接类型(比如 Telnet、Rlogin 以及 SSH 等)。根据你选择的连接类型,PuTTY 会自动选择对应连接类型的默认端口号(比如 SSH 是 22、Telnet 是 23),如果你修改了默认端口号,别忘了手动把它输入到 **端口** 里。在这里,我用 SSH 连接到远程主机。在输入所有信息后,请点击 **打开**。
|
||||
|
||||
![通过 SSH 连接](http://www.ostechnix.com/wp-content/uploads/2019/02/putty-1.png)
|
||||
|
||||
如果这是你首次连接到这个远程主机,PuTTY 会显示一个安全警告,问你是否信任你连接到的远程主机。点击 **接受** 即可将远程主机的密钥加入 PuTTY 的储存当中:
|
||||
|
||||
![PuTTY 安全警告][2]
|
||||
|
||||
接下来,输入远程主机的用户名和密码。然后你就成功地连接上远程主机啦。
|
||||
|
||||
![已连接上远程主机](https://www.ostechnix.com/wp-content/uploads/2019/02/putty-3.png)
|
||||
|
||||
#### 使用密钥验证访问远程主机
|
||||
|
||||
一些 Linux 管理员可能在服务器上配置了密钥认证。举个例子,在用 PuTTY 访问 AMS instances 的时候,你需要指定密钥文件的位置。PuTTY 可以使用它自己的格式(**.ppk** 文件)来进行公钥验证。
|
||||
|
||||
首先输入主机名或 IP。之后,在 **分类** 选项卡中,展开 **连接**,再展开 **SSH**,然后选择 **认证**,之后便可选择 **.ppk** 密钥文件了。
|
||||
|
||||
![][3]
|
||||
|
||||
点击接受来关闭安全提示。然后,输入远程主机的密码片段(如果密钥被密码片段保护)来建立连接。
|
||||
|
||||
#### 保存 PuTTY 会话
|
||||
|
||||
有些时候,你可能需要多次连接到同一个远程主机,你可以保存这些会话并在之后不输入信息访问他们。
|
||||
|
||||
请输入主机名(或 IP 地址),并提供一个会话名称,然后点击 **保存**。如果你有密钥文件,请确保你在点击保存按钮之前指定它们。
|
||||
|
||||
![][4]
|
||||
|
||||
现在,你可以通过选择 **已保存的会话**,然后点击 **Load**,再点击 **打开** 来启动连接。
|
||||
|
||||
#### 使用 <ruby>pscp<rt>PuTTY Secure Copy Client</rt></ruby> 来将文件传输到远程主机中
|
||||
|
||||
通常来说,Linux 用户和管理员会使用 **scp** 这个命令行工具来从本地往远程主机传输文件。不过 PuTTY 给我们提供了一个叫做 <ruby>PuTTY 安全拷贝客户端<rt>PuTTY Secure Copy Client</rt></ruby>(简写为 **PSCP**)的工具来干这个事情。如果你的本地主机运行的是 Windows,你可能需要这个工具。PSCP 在 Windows 和 Linux 下都是可用的。
|
||||
|
||||
使用这个命令来将 **file.txt** 从本地的 Arch Linux 拷贝到远程的 Ubuntu 上:
|
||||
|
||||
```shell
|
||||
pscp -i test.ppk file.txt sk@192.168.225.22:/home/sk/
|
||||
```
|
||||
|
||||
让我们来拆分这个命令:
|
||||
|
||||
* **-i test.ppk** : 访问远程主机的密钥文件;
|
||||
* **file.txt** : 要拷贝到远程主机的文件;
|
||||
* **sk@192.168.225.22** : 远程主机的用户名与 IP;
|
||||
* **/home/sk/** : 目标路径。
|
||||
|
||||
|
||||
|
||||
要拷贝一个目录,请使用 <ruby>**-r**<rt>Recursive</rt></ruby> 参数:
|
||||
|
||||
```shell
|
||||
pscp -i test.ppk -r dir/ sk@192.168.225.22:/home/sk/
|
||||
```
|
||||
|
||||
要使用 pscp 传输文件,请执行以下命令:
|
||||
|
||||
```shell
|
||||
pscp -i test.ppk c:\documents\file.txt.txt sk@192.168.225.22:/home/sk/
|
||||
```
|
||||
|
||||
你现在应该了解了 PuTTY 是什么,知道了如何安装它和如何使用它。同时,你也学习到了如何使用 pscp 程序在本地和远程主机上传输文件。
|
||||
|
||||
以上便是所有了,希望这篇文章对你有帮助。
|
||||
|
||||
干杯!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-install-and-use-putty-on-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zhs852](https://github.com/zhs852)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: http://www.ostechnix.com/wp-content/uploads/2019/02/putty-2.png
|
||||
[3]: http://www.ostechnix.com/wp-content/uploads/2019/02/putty-4.png
|
||||
[4]: http://www.ostechnix.com/wp-content/uploads/2019/02/putty-5.png
|
Loading…
Reference in New Issue
Block a user