Re: Do-Over a mangled sudo password?
On Feb 3, 2006, at 7:38 PM, Paul Lussier wrote: Others have already provided working answers, so I won't bother reiterating :) And thanks to all for several great answers. A not-so-obvious thing, but one which might invoke a 'Duh!' would be to wrap up your commands into a shell script, then run the single shell script under sudo. Um. Duh. Very good! A nother not-so-obvious thing would be to use ssh-key-based commands. Set up key entries in root's authorized_keys file (or your own for that matter if you need to do things as root) which are limited to certain commands. This is *really* useful if you need to allow a certain person to ssh into a box to execute a very limited set of commands as root. Set up different keys for different commands, then when ssh'ing, you can specify which key to use, which in turn dictates which command to run on the remote side. That's good. The client is pretty flexible on what we do here, and you've given me some good ideas on how to set it up. Thanks! ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Do-Over a mangled sudo password?
Simple question, I expect, but haven't been able to locate the answer. I'm working in an environment where I have to sudo a number of commands when logged into a remote machine via ssh. The password is a doozy, with upper-, lower- punctuation, numbers and a spin of the secret decoder ring. Inevitably, I get halfway through the password entry and miss a character, slip off the shift key, forget where I was or something. Is there a way to clear the characters I've entered and start again, without hitting enter, waiting for the timeout, hoping I haven't exceed the limit and trying again? I suspect this is one of those Everyone knows it's Ctrl-K but I must have dozed off in class. Ted Roche Ted Roche Associates, LLC http://www.tedroche.com ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
On Fri, 2006-02-03 at 11:54 -0500, Ted Roche wrote: Simple question, I expect, but haven't been able to locate the answer. I'm working in an environment where I have to sudo a number of commands when logged into a remote machine via ssh. The password is a doozy, with upper-, lower- punctuation, numbers and a spin of the secret decoder ring. Inevitably, I get halfway through the password entry and miss a character, slip off the shift key, forget where I was or something. Is there a way to clear the characters I've entered and start again, without hitting enter, waiting for the timeout, hoping I haven't exceed the limit and trying again? I suspect this is one of those Everyone knows it's Ctrl-K but I must have dozed off in class. Ctrl-U? ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
On 2/3/06, Ted Roche [EMAIL PROTECTED] wrote: I'm working in an environment where I have to sudo a number of commands when logged into a remote machine via ssh. Is there a way to clear the characters I've entered and start again, without hitting enter, waiting for the timeout, hoping I haven't exceed the limit and trying again? Um, maybe I'm missing something obvious here, but have you tried the [BACKSPACE] key? My preferred technique is to position my index and middle fingers over the key and alternate them back and forth very quickly a couple dozen times. :-) -- Ben It's the most used key on my keyboard Scott ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
On Fri, Feb 03, 2006 at 11:58:38AM -0500, Stephen Ryan wrote: On Fri, 2006-02-03 at 11:54 -0500, Ted Roche wrote: I suspect this is one of those Everyone knows it's Ctrl-K but I must have dozed off in class. Ctrl-U? Yep. and it works almost everywhere: [1 [EMAIL PROTECTED] ~]$ telnet crschmidt.net 80 Trying 64.92.170.181... Connected to crschmidt.net. Escape character is '^]'. GET / HT^UGET / HTTP/1.0 will work as you would expect. I find it useful in Python interactive shell stuff too. -- Christopher Schmidt Web Developer ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
On Feb 3, 2006, at 11:54, Ted Roche wrote: Everyone knows it's Ctrl-K Everyone knows it's Ctrl-W (rub to beginning of region) Pretty soon you'll start using it on the shell, and then even in emacs. Watch out! And if you have too many buttons on your mouse/trackball you can define one of those with the 'certificate'. That'll teach them to ignore public key authentication. -Bill - Bill McGonigle, Owner Work: 603.448.4440 BFC Computing, LLC Home: 603.448.1668 [EMAIL PROTECTED] Cell: 603.252.2606 http://www.bfccomputing.com/Page: 603.442.1833 Blog: http://blog.bfccomputing.com/ VCard: http://bfccomputing.com/vcard/bill.vcf ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
On Fri, Feb 03, 2006 at 02:51:59PM -0500, Bill McGonigle wrote: On Feb 3, 2006, at 11:54, Ted Roche wrote: Everyone knows it's Ctrl-K Everyone knows it's Ctrl-W (rub to beginning of region) Pretty soon you'll start using it on the shell, and then even in emacs. Watch out! I thought ^W was 'Back word' -- works like that in vim, but ^U does what I thought he wanted... -- Christopher Schmidt Web Developer ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
On Feb 3, 2006, at 3:15 PM, Christopher Schmidt wrote: On Fri, Feb 03, 2006 at 02:51:59PM -0500, Bill McGonigle wrote: On Feb 3, 2006, at 11:54, Ted Roche wrote: Everyone knows it's Ctrl-K Everyone knows it's Ctrl-W (rub to beginning of region) I thought ^W was 'Back word' -- works like that in vim, but ^U does what I thought he wanted... Well, it sounds like... There's More Than One Way To Do It! (tm) Ted Roche Ted Roche Associates, LLC http://www.tedroche.com ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Do-Over a mangled sudo password?
Ted Roche [EMAIL PROTECTED] writes: Simple question, I expect, but haven't been able to locate the answer. Others have already provided working answers, so I won't bother reiterating :) I'm working in an environment where I have to sudo a number of commands when logged into a remote machine via ssh. Have you thought of a different approach? I don't know what your limitations are wrt sudo use (i.e., are you using it for it's logging/safety, or has it been imposed upon you by your sysadmin?) Assuming you can do anything you want, you just need to provide a password, one obvious thing is to 'sudo su', then run the commands you need. Another obvious thing, provided you have the capability, is to ssh directly to the remote machine as root, completely by-passing sudo. A not-so-obvious thing, but one which might invoke a 'Duh!' would be to wrap up your commands into a shell script, then run the single shell script under sudo. A nother not-so-obvious thing would be to use ssh-key-based commands. Set up key entries in root's authorized_keys file (or your own for that matter if you need to do things as root) which are limited to certain commands. This is *really* useful if you need to allow a certain person to ssh into a box to execute a very limited set of commands as root. Set up different keys for different commands, then when ssh'ing, you can specify which key to use, which in turn dictates which command to run on the remote side. Of course, all these things require that you have a little flexibility with your sudo/ssh environment. -- Seeya, Paul ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss