PuTTY SSH客户端使用教程(详细图文)

Kevin 教程 5,088 次浏览 51条评论

作为免费且开源的老牌SSH客户端,PuTTY经常用于Windows下连接管理远程服务器。为方便刚接触VPS的新手参考使用,本文配合截图介绍PuTTY的基础用法及一些设置技巧,希望对大家有所帮助。

PuTTY下载及相关功能组件

SSH客户端这类涉及服务器登录和通信的软件,建议大家尽量使用原版(曾有汉化版被曝存在安全后门),PuTTY官方下载地址 https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

在下载页提供有集成PuTTY相关程序的安装包,也可以视需求单独下载某个功能程序使用。

putty.exe SSH和Telnet客户端(最常使用的)
pscp.exe SCP客户端,命令行下通过SSH远程拷贝文件
psftp.exe SFTP客户端,命令行下的文件传输会话
puttytel.exe 一个单纯Telnet客户端
plink.exe PuTTY后端的命令行工具
pageant.exe PuTTY、PSCP、Plink的SSH认证代理
puttygen.exe RSA、DSA、ECDSA和EdDSA密钥生成工具

PuTTY连接登录远程服务器

运行putty.exe,在程序界面内输入服务器IP地址和端口(22是SSH默认端口),选中SSH连接类型,设置连接会话名称及点击保存,然后点击Open按钮开始连接登录。

PuTTY SSH连接登录设置

首次连接服务器,会提示该服务器指纹。可以点击是或否。点击“是”将保存指纹,“否”则不保存。保存后登录同一台服务器将不再提示(如果提示,则表示服务器指纹发生了变化,可能是重装系统所致或连接服务器被冒充)

SSH连接服务器密钥指纹

之后输入用户名和密码即可登录服务器(输入密码时不会显示输入状态,这是一个安全设计。点击鼠标右键可以粘贴输入)

输入用户名密码登录服务器

如果需要注销连接会话,使用exit命令或Ctrl+d快捷键。

PuTTY如何修改保存设置

估计不少人遇到过这个问题,不知道怎么保存PuTTY设置修改。正确方法是先选中PuTTY存储会话,然后点击Load加载设置,这时就可以开始修改设置了,最后点击保存会话设置。

如果需要修改PuTTY默认设置,就选中修改Default Setting会话。

保存PuTTY设置

设置PuTTY会话保持时间

当与服务器长时间没数据传输,PuTTY会自动断开连接。这样有时会给使用带来麻烦,可以在Connection选项Seconds between keepalives里设置会话保持时间,单位为秒,比如设置600(10分钟)

设置PuTTY会话保存时间

PuTTY复制粘贴文本方法

在SSH会话窗口中不能使用Ctrl+C这样的快捷键复制(Ctrl+C作用于终止命令执行),复制粘贴需要依赖鼠标。复制操作先用鼠标左键拖拽选中,然后单击一下选中的文字部分即可(如果复制内容太长,可以通过鼠标中键分别点击一次首尾字符快速选中,这样不必一直按住鼠标滑动)。粘贴操作则由单击鼠标右键完成。

对于一些使用鼠标操作的程序,上面方法可能不适用,例如Links命令行浏览器。需要先按住Shift键,然后再配合鼠标操作。

PuTTY窗口内容显示长度修改

当打开一个很长内容的文件,或者程序命令不断输出内容,PuTTY会话窗口只显示最后2000行内容。如果需要调整,在Windows选项里修改Lines of scrollback数值。

设置PuTTY会话窗口显示长度

PuTTY保存会话登录用户名

如果登录服务器习惯用同一个用户账号,比如root身份,那么可以设置会话默认登录用户名,免去每次输入麻烦。在Connection选项Date里设置,下图所示。

设置PuTTY会话自动登录用户名

PuTTY没有提供保存会话登录密码的功能,不过仍有方法实现。首先鼠标右键点击putty.exe创建一个桌面快捷方式,打开快捷方式属性,在快捷方式目标里添加会话参数,格式如下:

D:\putty.exe -load "会话名称" -l "登录用户名" -pw "登录密码"

PuTTY使用私钥方式登录

这里只介绍PuTTY设置密钥登录方法,关于创建密钥对及在服务器端的配置,后续会另开文章介绍。

依次打开Connection -> SSH -> Auth选项,浏览选中私钥文件,保存设置后即可使用密钥方式登录。

PuTTY设置私钥文件

如果登录提示下面这个错误,是因为PuTTY不支持PEM格式密钥。需要使用puttygen.exe转换一下。

Unable to use key file "D:\id_rsa" (OpenSSH SSH-2 private key (old PEM format))

运行puttygen.exe,点击Load导入私钥文件(如果有设置保护密码,需要先输入密码),然后点击Save private key另存为ppk后缀密钥文件(需要手动输文件后缀名)

Puttygen转换密钥文件格式

PuTTY会话配置信息删除

除了在PuTTY选项里删除连接会话外,也可以直接删除软件注册表信息。WIN+R打开运行窗口,输入regedit打开注册表编辑器,找到PuTTY注册表信息删除。路径如下。

HKEY_CURRENT_USER\Software\SimonTatham\PuTTY

PuTTY使用方法就介绍到这里了。关于文件传输,建议使用支持图形化界面的SFTP软件,如WinSCP、FileZilla这些,操作体验会更好一些。

评论列表

  1. #1

    Hi, very nice website, cheers!
    ——————————————————
    Need cheap and reliable hosting? Our shared plans start at $10 for an year and VPS plans for $6/Mo.
    ——————————————————
    Check here: https://www.reliable-webhosting.com/

  2. #2

    can dapoxetine treat bph https://salemeds24.wixsite.com/dapoxetine

  3. #3

    bimatoprost ophthalmic solution india https://carepro1st.com/

  4. #4

    vivitrol naltrexone pills https://naltrexoneonline.confrancisyalgomas.com/

  5. #5

    cost of sildenafil citrate 100 mg http://droga5.net/

  6. #6

    strength of ivermectin tablets https://ivermectin.webbfenix.com/

  7. #7

    tadalafil vidalista 20 mg https://vidalista.mlsmalta.com/

  8. #8

    vidalista generic best prices india https://vidalista.buszcentrum.com/

  9. #9

    does cephalexin expire https://keflex.webbfenix.com/

  10. #10

    liquid tadalafil 30mg cialis 30 http://www.lm360.us/

  11. #11

    hydroxychloroquine canada online only https://hydroxychloroquine.mlsmalta.com/

  12. #12

    ivermectin for birds for sale https://ivermectin.mlsmalta.com/

  13. #13

    hydroxychloroquine 200mg coronavirus https://hydroxychloroquine.webbfenix.com/

  14. #14

    dapoxetine delivered overnight https://dapoxetine.bee-rich.com/

  15. #15

    60mg dapoxetine daily effects https://ddapoxetine.com/

  16. #16

    vidalista price comparison https://vidalista40mg.mlsmalta.com/

  17. #17

    cialis cost in usa https://wisig.org/

  18. #18

    albuterol sulfate for cough https://amstyles.com/

  19. #19

    brand cialis 5 mg https://tadalafili.com/

  20. #20

    hydroxychloroquine coronavirus https://sale.azhydroxychloroquine.com/

  21. #21

    tadalafil cialis 5 mg tablet https://tadalafil.cleckleyfloors.com/

  22. #22

    Very nice post. I simply stumbled upon your weblog and wished to mention that I’ve truly enjoyed surfing around your blog posts. https://local-auto-locksmith.co.uk/ford/

  23. #23

    order medications online https://medpills.bee-rich.com/

  24. #24

    order medications online https://edmeds.buszcentrum.com/

  25. #25

    Thanks for your own work on this website. My mum take interest in setting aside time for research and it is simple to grasp why. We notice all relating to the powerful way you provide very helpful tips via your website and therefore strongly encourage response from visitors on this subject matter while our own simple princess is undoubtedly studying so much. Take pleasure in the rest of the year. Your performing a tremendous job. https://bupronbupropion.com/

  26. #26

    Thank you for your entire labor on this web site. My mom take interest in participating in investigations and it is obvious why. My partner and i learn all regarding the lively tactic you produce simple thoughts through your web site and in addition invigorate response from the others on the subject then our favorite princess is truly studying a whole lot. Take advantage of the rest of the year. You have been doing a superb job. https://endepamitriptyline.com/

  27. #27

    I am only writing to make you understand what a superb experience our princess undergone viewing your webblog. She picked up such a lot of things, with the inclusion of what it is like to possess an ideal teaching spirit to make the mediocre ones without difficulty master specified tricky topics. You undoubtedly surpassed readers’ expected results. Thanks for rendering those useful, trustworthy, revealing as well as unique tips on your topic to Sandra. https://paxilparoxetines.com/

  28. #28

    I am also writing to make you know what a incredible encounter my friend’s girl gained reading through your web page. She learned plenty of pieces, which include what it’s like to possess an amazing helping mood to let other folks smoothly know just exactly several multifaceted subject matter. You truly exceeded our own expectations. Thank you for offering these necessary, safe, explanatory and even fun tips about this topic to Julie. https://seroquelquetiapine.com/#

  29. #29

    I am commenting to let you know of the fantastic encounter my cousin’s daughter experienced reading your site. She even learned many issues, not to mention what it’s like to have a wonderful giving mindset to have many people just grasp chosen grueling subject areas. You really exceeded our expectations. Many thanks for distributing the informative, healthy, educational and as well as easy thoughts on the topic to Jane. https://seroquelquetiapine.com/#

  30. #30

    buy cheap tadalafil 20mg online https://tadfil.online/

  31. #31

    buy tadalafil overnight delivery https://cialis.lm360.us/

  32. #32

    buy tadalafil overnight delivery https://cialis.grassfed.us/

  33. #33

    Thanks for this post, I am a big big fan of this site would like to proceed updated.

    http://www.vreyrolinomit.com/

  34. #34

    I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

    http://www.vreyrolinomit.com/

  35. #35

    ivermectin 3 mg for humans https://ivermectin1st.com/

  36. #36

    hydroxychloroquine sulfate oral https://hhydroxychloroquine.com/

  37. #37

    Thank you for sharing superb informations. Your web site is so cool. I am impressed by the details that you’ve on this web site. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found simply the info I already searched all over the place and just couldn’t come across. What a great web-site.

    http://www.zortilonrel.com/

  38. #38

    buy hydroxychloroquine online https://hydroxychloroquinex.com/

  39. #39

    me encantei com este site. Para saber mais detalhes acesse o site e descubra mais. Todas as informações contidas são informações relevantes e exclusivas. Tudo que você precisa saber está está lá.

    https://corporality.global/

  40. #40

    Thank you for the good writeup. It actually was once a entertainment account it. Glance advanced to more added agreeable from you! By the way, how can we keep up a correspondence?

    http://www.easoar-soon.com

  41. #41

    naturally like your web-site however you have to check the spelling on several of your posts. Many of them are rife with spelling issues and I in finding it very bothersome to inform the reality however I will surely come again again.

    https://citizenshipforsale.co

  42. #42

    I’m really enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Excellent work!

    https://www.youtube.com/watch?v=pWwPxHlnbU8

  43. #43

    Hello, you used to write magnificent, but the last few posts have been kinda boring… I miss your great writings. Past several posts are just a little bit out of track! come on!

    http://www.vreyrolinomit.com/

  44. #44

    buying generic cialis https://cialis360.jueriy.com/

  45. #45

    buying generic cialis https://cialis.stdstory.com/

  46. #46

    I have recently started a blog, the information you offer on this website has helped me tremendously. Thank you for all of your time & work. “Patriotism is often an arbitrary veneration of real estate above principles.” by George Jean Nathan.

    https://www.youtube.com/watch?v=tm_FEaULxf8

  47. #47

    Hi, Neat post. There’s a problem together with your web site in web explorer, would check this?K IE still is the marketplace leader and a huge section of other people will miss your excellent writing due to this problem.

    https://www.youtube.com/watch?v=3s7eaFj6XxE

  48. #48

    I have recently started a website, the information you offer on this website has helped me greatly. Thank you for all of your time & work. “There can be no real freedom without the freedom to fail.” by Erich Fromm.

    https://www.youtube.com/watch?v=vIeo40k99nY

  49. #49

    Your style is so unique compared to many other people. Thank you for publishing when you have the opportunity,Guess I will just make this bookmarked.2

    https://www.youtube.com/watch?v=_bPSWABggX8

  50. #50

    I have recently started a blog, the info you offer on this web site has helped me tremendously. Thanks for all of your time & work.

    https://www.youtube.com/watch?v=yRUUMTPhLH0

  51. #51

    Very good blog! Do you have any hints for aspiring writers? I’m planning to start my own blog soon but I’m a little lost on everything. Would you suggest starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m totally overwhelmed .. Any recommendations? Thank you!

    https://www.youtube.com/watch?v=pWwPxHlnbU8

发表评论

电邮地址用于 Gravatar 头像显示,不会被公开可见。