lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Rpi, Putty and sending a "Break" command/signal.

Mon Dec 26, 2016 8:46 pm

I have putty on a PC and to send a ^C (break) you go to the top window bar, RMB, scroll down to "special commands" and select Send Break. Or something very much like that.

Alas on the PUTTY I have on the Rpi, that doesn't work. All I get are a list of options for that window.
So I am not sure it is a "putty problem" or a "Rpi problem".

Could someone help me with this please?

Thanks.
Searches on the net have been futile for "Raspberry pi, putty, break"

MrEngman
Posts: 3919
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Rpi, Putty and sending a "Break" command/signal.

Mon Dec 26, 2016 8:51 pm

I connect to my Pis using SSH, from PUTTY, from my windows laptop but only using a terminal window. All I do is type cntl-C if I want to send break to my Pi.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Mon Dec 26, 2016 9:05 pm

Ok.......

Sorry, but you lost me.


(I'm stuck between "posting toooo much information" and "NOT ENOUGH!".)


I am learning (or TRYING TO) CISCO network stuff. The problem of CONSOLE access to their devices arose recently.
Until now, I have had to use the PC (windoze machine) to access them as it has a USB-Serial converter.

This became too annoying and so I did some searching and found you can use them on the Pi too!
Luckily mine was one which works.
So I can now connect to most of the devices ok.
Alas, now, this one came along and spoilt the party.

I need to send it a ^c signal.
On the PC - as stated - it is "easy" as in: I can see how to do it and it works.
But the putty program on the PI seems to lack this function.


As I am still a bit of a "noob" at the Pi, I am stuck understanding what you said.
Reading it, you are connecting TO the Pi.

I am wanting to connect FROM the Pi and send a ^c signal to the other device.

Thanks again though.

jahboater
Posts: 4929
Joined: Wed Feb 04, 2015 6:38 pm

Re: Rpi, Putty and sending a "Break" command/signal.

Mon Dec 26, 2016 9:21 pm

I never use Putty, I just use ssh. ssh passes through ^C fine.

To test, I logged into a Pi over ssh from a Linux box. ^C works of course.
I then logged into another Pi from the first Pi again with ssh. ^C still works fine.

So I suggest ssh (its already included within Raspbian, you don't have to install anything, unlike putty which has a gazillion dependencies).

Just do "ssh pi@hostname", there is no gui.
You also have "scp" which is great for copying files around.

Furthermore, you should be able to set up public/private key authentication which means you no longer get prompted for a password (and is much more secure). Saves a lot of time. Lookup ssh-keygen and ssh-copy-id.

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Mon Dec 26, 2016 9:31 pm

Again, we seem to be talking at very different levels.....
Just do "ssh pi@hostname", there is no gu
How do I do this when I am using the USB/SERIAL port?
There is no hostname.
The device has no "log in"..... It is a CISCO ROUTER.

I simply want a terminal connected to it (from the Pi) 9600 baud, 8n1, and can send ^c.


lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Mon Dec 26, 2016 10:13 pm

Thanks very much.

I never would have "guessed" those words.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Rpi, Putty and sending a "Break" command/signal.

Tue Dec 27, 2016 5:42 pm

lerner wrote:Again, we seem to be talking at very different levels.....
Just do "ssh pi@hostname", there is no gu
How do I do this when I am using the USB/SERIAL port?
There is no hostname.
The device has no "log in"..... It is a CISCO ROUTER.

I simply want a terminal connected to it (from the Pi) 9600 baud, 8n1, and can send ^c.
I don't know what sort of Cisco device you're using, every Cisco I've used can be configured for telnet and/or ssh access which is generally a lot easier to use than the serial console.

As for break on a cisco command line I've often seen references to sending ctrl-5 and ctrl-6 as well as the cisco break.

For the rest of the post Ctrl-C and Break aren't necessarily the same thing. Break is a serial sequence that only applies on the serial link. Ctrl-C is generally an ascii sequence that the OS/application can interpret as a break sequence (and may do something similar with or not).

As an aside some unix systems used to also interpret a serial break which would take you from the running OS back to the prom (a bit like the bios on a PC), If you had a keyboard and mouse attached you may also have managed the same thing with a certain keyboard combination (Stop-a on Sun's from memory)

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Tue Dec 27, 2016 9:35 pm

Um,

Ok..... But that needs to be configured. As in: It is not the default.

Since I started this quest, the only two ways to connect were via the console connector - which was a MUST at the start - and via telnet (putty) after you have set up passwords and stuff.

Whether this is the "BEST" way or not is beyond me. It is how I have been shown.

I tried - maybe once - to set up use names, but failed, so didn't continue on that line as there was no need at that point.

So, to the best of my knowledge, I am only able to telnet in from other devices on the network - once set up.
The "problem" was that I had set up some kind of password on a particular device and no matter what I did on the CONSOLE connection, I couldn't log in.

I needed to rest the device and that means going to ROMMON mode and all that stuff.
Kinda difficult when you can't send a BREAK signal during boot - using the RPI and putty.
Using windows and putty, it was easy - save the fact it takes about 5 minutes to boot (the PC that is).

ITMT, I had to resign myself to booting it and doing that, as the PI just wasn't able to do it.

I would like to learn this new way of logging in with user name etc, but I need a way so that if I need to reset the device: It will work.


After that, I can see how this alternative method would/could be better. But at this point, it is beyond me.
I am trying now only playing with ROUTING stuff. Passwords and the like are not needed as it is my local LAB and I am playing.

Having passwords adds a whole new layer which at this point is not needed - and maybe also beyond me knowledge.

(I feel I am repeating myself too much in this post, so shall quit while I'm ahead.)

Thanks.

User avatar
jojopi
Posts: 3110
Joined: Tue Oct 11, 2011 8:38 pm

Re: Rpi, Putty and sending a "Break" command/signal.

Tue Dec 27, 2016 10:09 pm

Ctrl and right click in the putty window appears to bring up the menu that you need.

(Right click by itself is used to create or extend a selection in many terminals.)

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Tue Dec 27, 2016 10:14 pm

{hugs hugs hugs}

Thanks!

I didn't know that magic thing.

I'll give it a go.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Rpi, Putty and sending a "Break" command/signal.

Wed Dec 28, 2016 12:07 am

lerner wrote: Ok..... But that needs to be configured. As in: It is not the default.

I tried - maybe once - to set up use names, but failed, so didn't continue on that line as there was no need at that point.
Going off topic here so #i won't carry on much more after this unless others are also interested, but...

Setting a password and enabling telnet only requires a few lines of config (set a vty password, set an enable password, enable telnet).

Personally something like that I'll add the config but not save over serial. Then login over telnet /ssh, once logged in over telnet/ssh save the config. That way if it doesn't work you still have an active serial login you can use to revert the config. And in a worst case scenario you can reboot to restore the last saved config.

When looking at longer things (like the output of sh log, or enabling debug modes) a telnet session is much faster. looking at 1000's of log lines over 9600bd serial is slow and annoying.

There's an extension of the reboot to get a old config back that's good when configuring a remote site.
1) Login
2) Save config
3) set a reboot (reload in 20, or reload at 08:30)
4) make changes
5) reload cancel
6) save config (possible after a period to check for issues)
The benefit being that if your changes do cut you off, the programmed reboot will restore the previous config. If it all works you can cancel the reboot before the scheduled time (every time I've used that process the config has gone well, the few times I've not done it there's been a frantic phoning around to find someone on the remote site or a drive up the motorway to fix it).

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Wed Dec 28, 2016 3:29 am

Thanks mfs298.

I shall get to that stage at some point, I am sure.

For now though, passwords are only another level of complication I don't need.
I had a router set up and working, but hadn't logged in for a few months. Somehow I had forgotten the password or something and couldn't log in.

I had to reset it. (I had got to log in and gone to ROMMON mode, but the passwords I entered were there, but not accepted. I just wiped it and started again. Nothing too exciting lost.)


Also going off topic, I hear there is a way to create public/private keys and use them to log in rather than names/passwords.
That would be great to apply, but again: not at this stage, when I am still learning about routing, rather than concerned with passwords.
I shall probably apply that to my pi's as well, but.... again: FUTURE stuff.

jahboater
Posts: 4929
Joined: Wed Feb 04, 2015 6:38 pm

Re: Rpi, Putty and sending a "Break" command/signal.

Wed Dec 28, 2016 9:02 am

lerner wrote:Thanks mfs298.

I shall get to that stage at some point, I am sure.

For now though, passwords are only another level of complication I don't need.

Also going off topic, I hear there is a way to create public/private keys and use them to log in rather than names/passwords.
That would be great to apply, but again: not at this stage, when I am still learning about routing, rather than concerned with passwords.
I shall probably apply that to my pi's as well, but.... again: FUTURE stuff.
Just type "ssh-keygen" and accept the defaults (once on your main PC).
Then "ssh-copy-id pi@hostname" for each Raspberry Pi (or whatever user you are using on the pi). Give that users password and you are done.
After which you will no longer be asked for a password every time you scp or ssh - much quicker and far more secure.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Rpi, Putty and sending a "Break" command/signal.

Wed Dec 28, 2016 9:45 am

Here's my method of dealing with passwords FWIW.

I write them down. I know that's supposed to be very naughty, but bear with me. I write them in a little book that is sitting here on a shelf in my home. The only hackers who are ever going to see it are the ones that physically break into my house to steal my computer. In practise, unless the book is huge and has "PASSWORDS" in gilded letters on it, even a thief is not going to notice it, and they probably won't care either.

That way I do not need to chose a password I can remember. Instead I can choose a strong password of random characters. That makes my online security all the better at the expense of having to consult the little book.

You have to be sure of your physical security of course; this doesn't work in an office environment or when you don't trust members of your household.

lerner
Posts: 508
Joined: Sun Mar 29, 2015 12:12 am

Re: Rpi, Putty and sending a "Break" command/signal.

Wed Dec 28, 2016 8:00 pm

jahboater wrote:Just type "ssh-keygen" and accept the defaults (once on your main PC).
Then "ssh-copy-id pi@hostname" for each Raspberry Pi (or whatever user you are using on the pi). Give that users password and you are done.
After which you will no longer be asked for a password every time you scp or ssh - much quicker and far more secure.
Dumb question:
Where/which machine? The router/CISCO thing of the rpi?

runwin:
I fully agree with you and I do have them written down.
It would seem that I did something else ITMT which overrides them and mucked up logging in.
I am only (now) wanting to avoid passwords for that reason: Needing to "log in" every time I connect.

But again: Thanks to all. I am actually moving forward - which is novel - and learning things.
That is good.
:)

Return to “General discussion”