如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

CPU/显卡/打印机/USB设备等硬件问题
回复
Valdis
帖子: 11
注册时间: 2012-01-14 23:11

如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#1

帖子 Valdis » 2012-04-02 11:23

我的笔记本上没有 Serial 接口,找了一个USB 转 RS232 插在了USB 接口上。
通过 lsusb 在终端里可以看到:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 002: ID 044e:300d Alps Electric Co., Ltd Bluetooth Controller (ALPS/UGPZ6)
Bus 005 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
通过 dmseg 在终端里可以看到:
[ 23.990031] wlan0: associated
[ 23.994123] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 34.688097] wlan0: no IPv6 routers present
[ 39.250231] audit_printk_skb: 54 callbacks suppressed
[ 39.250237] type=1400 audit(1333334754.770:30): apparmor="DENIED" operation="file_mmap" parent=1899 profile="/usr/lib/telepathy/telepathy-*" name="/usr/lib/purple-2/libqq.so" pid=1900 comm="telepathy-haze" requested_mask="m" denied_mask="m" fsuid=1000 ouid=1000
[ 39.250463] type=1400 audit(1333334754.770:31): apparmor="DENIED" operation="file_mmap" parent=1899 profile="/usr/lib/telepathy/telepathy-*" name="/usr/lib/purple-2/libqq.so" pid=1900 comm="telepathy-haze" requested_mask="m" denied_mask="m" fsuid=1000 ouid=1000
[ 161.382611] WARNING! power/level is deprecated; use power/control instead
[ 161.463812] usb 2-1: USB disconnect, device number 2
[ 163.336140] usb 5-2: USB disconnect, device number 2
[ 166.956072] usb 5-2: new full-speed USB device number 3 using uhci_hcd
[ 167.209600] usbcore: registered new interface driver usbserial
[ 167.209619] USB Serial support registered for generic
[ 167.209667] usbcore: registered new interface driver usbserial_generic
[ 167.209670] usbserial: USB Serial Driver core
[ 167.251461] USB Serial support registered for pl2303
[ 167.251494] pl2303 5-2:1.0: pl2303 converter detected
[ 167.262960] usb 5-2: pl2303 converter now attached to ttyUSB0
[ 167.262981] usbcore: registered new interface driver pl2303
[ 167.262983] pl2303: Prolific PL2303 USB to serial adaptor driver
[ 172.264127] usb 5-2: USB disconnect, device number 3
[ 172.264366] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[ 172.264381] pl2303 5-2:1.0: device disconnected
[ 182.284103] usb 5-2: new low-speed USB device number 4 using uhci_hcd
[ 182.476477] input: PixArt USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/input/input11
[ 182.476837] generic-usb 0003:093A:2510.0002: input,hidraw0: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:1d.0-2/input0
[ 184.904255] usb 5-1: new full-speed USB device number 5 using uhci_hcd
[ 185.062755] pl2303 5-1:1.0: pl2303 converter detected
[ 185.074956] usb 5-1: pl2303 converter now attached to ttyUSB0
[ 846.344260] usb 5-1: USB disconnect, device number 5
[ 846.346404] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[ 846.346439] pl2303 5-1:1.0: device disconnected
[ 849.560204] usb 5-1: new full-speed USB device number 6 using uhci_hcd
[ 849.714504] pl2303 5-1:1.0: pl2303 converter detected
[ 849.726485] usb 5-1: pl2303 converter now attached to ttyUSB0

但是通过 Putty 连接时 显示的是:
Unable to open connection to :
Unable to open serial port
现在不知道怎么解决,不知道有没有同胞和我遇到的问题是一样的。一样的话你们是怎么解决的/。 或者是哪位大侠帮小弟解决解决 。Linux 我算是新手 。
在这里先提前谢谢了。
头像
ljj_jjl2008
论坛版主
帖子: 14256
注册时间: 2007-09-16 8:29

Re: 如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#2

帖子 ljj_jjl2008 » 2012-04-02 12:21

我是被楼主标题吸引进来的。
然后,实话说,我没有看懂。 :em03
fancsxx
帖子: 2
注册时间: 2010-07-12 16:11

Re: 如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#3

帖子 fancsxx » 2012-08-21 11:16

需要权限才可以读取/dev/下面的目录,你这样启动就行了。
sudo putty
flyingbigsandy
帖子: 1
注册时间: 2015-01-26 10:19
系统: Ubuntu kylin

Re: 如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#4

帖子 flyingbigsandy » 2015-01-26 10:23

用sudo来试试,实在不行看看有木有把流控关掉呢?
onlylove
论坛版主
帖子: 5371
注册时间: 2007-01-14 16:23

Re: 如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#5

帖子 onlylove » 2015-01-26 21:10

minicom路过……putty是windows下面常用的,linux下没用过……
只问下,你串口设置对了么?哦,还有楼上问的,权限有么?
#include <stdio.h>
void main()
{
double world;
unsigned letter;
short stay;
long memories;
printf("I miss you.\n");
}
头像
oneleaf
论坛管理员
帖子: 10455
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

Re: 如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#6

帖子 oneleaf » 2015-01-27 9:18

试试 :

sudo chmod 666 /dev/ttyUSB0
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 如何使用 Putty 在Ubuntu连接 Serial 端口连接 Cisco 路由器 ?

#7

帖子 poloshiao » 2015-01-27 9:51

http://ubuntuforums.org/showthread.php? ... st12766624
The issue is that root owns the device /dev/ttyUSB0 therefore in order to use the connection the console software must also run as root. From the terminal: sudo putty then all console connections work as expected on both devices.
回复