首页 > 其他 > 详细

putty使用小结

时间:2014-03-03 23:23:54      阅读:640      评论:0      收藏:0      [点我收藏+]

PuTTY is a free implementation of Telnet and SSH for Windows and Unix platforms, along with an xterm terminal emulator. It is written and maintained primarily by Simon Tatham.

More...

工具汇总

  • PuTTY (the Telnet and SSH client itself)
  • PSCP (an SCP client, i.e. command-line secure file copy)
  • PSFTP (an SFTP client, i.e. general file transfer sessions much like FTP)
  • PuTTYtel (a Telnet-only client)
  • Plink (a command-line interface to the PuTTY back ends)
  • Pageant (an SSH authentication agent for PuTTY, PSCP, PSFTP, and Plink)
  • PuTTYgen (an RSA and DSA key generation utility).

下载地址

windows和linux互传文件

环境:ubuntu+ssh;windows+putty(pscp)

首先配置ubuntu:

1.先使用netstat -tl service ssh status查看ssh服务是否开启,如果没有开启,用service ssh restart开启,如果没有安装,使用sudo apt-get install openssh-server安装ssh

2.检查防火墙
注:可以使用iptables,但我在ubuntu中没找到,会用的同学可以忽略下面的东西。
Ubuntu在它的发行版中,附带了一个相对iptables简单很多的防火墙配置工具:ufw
使用如下命令:
$sudo ufw default deny
$sudo ufw enable
通过第一命令,我们设置默认的规则为deny, 这样除非指明打开的端口, 否则所有端口默认都是关闭的。第二个命令则启动了ufw。如果下次重新启动机器, ufw也会自动启动。
然后开启22端口:
$sudo ufw allow 22
由于在/etc/services中, 22端口对应的服务名是ssh。所以下面的命令是一样的:
$sudo ufw allow ssh
现在可以通过下面命令来查看防火墙的状态了:
$sudo ufw status
Firewall loaded

To Action From
– —— —-
22:tcp ALLOW Anywhere
22:udp ALLOW Anywhere
可以看到,22端口的tcp和udp协议都打开了。

现在到windows中:

打开putty.exe,填入待连接主机IP,port选择22

bubuko.com,布布扣

连接成功:现在就可以像在ubuntu中使用命令行一样了

bubuko.com,布布扣

打开cmd窗口,输入命令:
pscp 源文件路径 root@hostIp:目的路径

如将aaa.jpg传到/home下,则:  pscp aaa.jpg root@192.168.0.101:/home

传输成功:

bubuko.com,布布扣

 

ls一下:

bubuko.com,布布扣

 

成功了!

可以不用root身份而用普通用户身份登陆连接,此时只能将文件传至用户对应的主目录下

从linux向windows传文件:

在windows的cmd中输入  pscp root@hostIp: linux中源文件路径   windows中目的路径

如:   pscp root@192.168.0.100:/home/aaa.jpg  G:/putty/

注意:使用pscp只能传文件,无法传目录,要传目录的话可以用psftp

可能会遇到的问题:

防火墙把一些IP封了之类的,到/etc/hosts.allow中加上一句ALL : ALL(允许所有的IP连接,这个真的很不好,还是设置成只允许特定的IP连接比较好)

 附:关于ufw可以参考http://www.cnblogs.com/ylan2009/articles/2321136.html

putty使用小结,布布扣,bubuko.com

putty使用小结

原文:http://www.cnblogs.com/Amagasaki/p/3578235.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!