|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
ssh and remote sudo not hiding passwordI can shut down a remote machine by connecting via ssh then shutting it down
ssh ip_address <logon messages> sudo shutdown -h now password: (entered pwd not visible) and the remote machine shuts down. To save typing (and brain power) I wrote a script on local machine ssh ip_addr sudo shutdown -h now When I run the script it works as expected and shuts down the remote machine, but when it prompts me for the password (for the sudo shutdown), the password I type is not hidden but is visible on screen, which is not good. I am sure there is a way round this but I have not managed to find it. Any help will be much appreciated. Colin -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordUse ssh keys
On Fri, Nov 6, 2009 at 3:46 PM, Colin Law <clanlaw@...> wrote: I can shut down a remote machine by connecting via ssh then shutting it down -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordColin Law wrote: > I can shut down a remote machine by connecting via ssh then shutting it down > ssh ip_address > <logon messages> > sudo shutdown -h now > password: (entered pwd not visible) > > and the remote machine shuts down. > To save typing (and brain power) I wrote a script on local machine > ssh ip_addr sudo shutdown -h now > When I run the script it works as expected and shuts down the remote > machine, but when it prompts me for the password (for the sudo > shutdown), the password I type is not hidden but is visible on screen, > which is not good. I am sure there is a way round this but I have not > managed to find it. Any help will be much appreciated. > > Colin > > Matt -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding password2009/11/6 Brent Bolin <brent.bolin@...>:
> Use ssh keys If I understand you correctly you mean that I should use keys to prevent the necessity for entering the password at all. In fact I already do this. The password is not for the ssh connection but for the sudo shutdown command. How can I use ssh keys to prevent having to enter pwd for sudo? Colin > > On Fri, Nov 6, 2009 at 3:46 PM, Colin Law <clanlaw@...> wrote: >> >> I can shut down a remote machine by connecting via ssh then shutting it >> down >> ssh ip_address >> <logon messages> >> sudo shutdown -h now >> password: (entered pwd not visible) >> >> and the remote machine shuts down. >> To save typing (and brain power) I wrote a script on local machine >> ssh ip_addr sudo shutdown -h now >> When I run the script it works as expected and shuts down the remote >> machine, but when it prompts me for the password (for the sudo >> shutdown), the password I type is not hidden but is visible on screen, >> which is not good. I am sure there is a way round this but I have not >> managed to find it. Any help will be much appreciated. >> >> Colin >> >> -- >> ubuntu-users mailing list >> ubuntu-users@... >> Modify settings or unsubscribe at: >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users > > -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordAs root
On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@...> wrote: 2009/11/6 Brent Bolin <brent.bolin@...>: -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordThink there is also an option in sudo to not prompt for passwd
On Fri, Nov 6, 2009 at 4:03 PM, Brent Bolin <brent.bolin@...> wrote: As root -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordChange sudo to NOPASSWD
You can get dangerous with sudo... Matt Brent Bolin wrote: > Think there is also an option in sudo to not prompt for passwd > > On Fri, Nov 6, 2009 at 4:03 PM, Brent Bolin <brent.bolin@... > <mailto:brent.bolin@...>> wrote: > > As root > > > On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@... > <mailto:clanlaw@...>> wrote: > > 2009/11/6 Brent Bolin <brent.bolin@... > <mailto:brent.bolin@...>>: > > Use ssh keys > > If I understand you correctly you mean that I should use keys to > prevent the necessity for entering the password at all. In fact I > already do this. The password is not for the ssh connection > but for > the sudo shutdown command. How can I use ssh keys to prevent > having > to enter pwd for sudo? > > Colin > > > > > On Fri, Nov 6, 2009 at 3:46 PM, Colin Law > <clanlaw@... <mailto:clanlaw@...>> wrote: > >> > >> I can shut down a remote machine by connecting via ssh then > shutting it > >> down > >> ssh ip_address > >> <logon messages> > >> sudo shutdown -h now > >> password: (entered pwd not visible) > >> > >> and the remote machine shuts down. > >> To save typing (and brain power) I wrote a script on local > machine > >> ssh ip_addr sudo shutdown -h now > >> When I run the script it works as expected and shuts down > the remote > >> machine, but when it prompts me for the password (for the sudo > >> shutdown), the password I type is not hidden but is visible > on screen, > >> which is not good. I am sure there is a way round this but > I have not > >> managed to find it. Any help will be much appreciated. > >> > >> Colin > >> > >> -- > >> ubuntu-users mailing list > >> ubuntu-users@... > <mailto:ubuntu-users@...> > >> Modify settings or unsubscribe at: > >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users > > > > > > -- > ubuntu-users mailing list > ubuntu-users@... > <mailto:ubuntu-users@...> > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/ubuntu-users > > > -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding password2009/11/6 Matt Brown <mbrown7776@...>:
> Change sudo to NOPASSWD > > You can get dangerous with sudo... I see that I can do that, but I don't like it. It is not entering the password that is the problem, it is that the pwd is not hidden when I type it. Colin > > Matt > > Brent Bolin wrote: >> >> Think there is also an option in sudo to not prompt for passwd >> >> On Fri, Nov 6, 2009 at 4:03 PM, Brent Bolin <brent.bolin@... >> <mailto:brent.bolin@...>> wrote: >> >> As root >> >> >> On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@... >> <mailto:clanlaw@...>> wrote: >> >> 2009/11/6 Brent Bolin <brent.bolin@... >> <mailto:brent.bolin@...>>: >> > Use ssh keys >> >> If I understand you correctly you mean that I should use keys to >> prevent the necessity for entering the password at all. In fact I >> already do this. The password is not for the ssh connection >> but for >> the sudo shutdown command. How can I use ssh keys to prevent >> having >> to enter pwd for sudo? >> >> Colin >> >> > >> > On Fri, Nov 6, 2009 at 3:46 PM, Colin Law >> <clanlaw@... <mailto:clanlaw@...>> wrote: >> >> >> >> I can shut down a remote machine by connecting via ssh then >> shutting it >> >> down >> >> ssh ip_address >> >> <logon messages> >> >> sudo shutdown -h now >> >> password: (entered pwd not visible) >> >> >> >> and the remote machine shuts down. >> >> To save typing (and brain power) I wrote a script on local >> machine >> >> ssh ip_addr sudo shutdown -h now >> >> When I run the script it works as expected and shuts down >> the remote >> >> machine, but when it prompts me for the password (for the sudo >> >> shutdown), the password I type is not hidden but is visible >> on screen, >> >> which is not good. I am sure there is a way round this but >> I have not >> >> managed to find it. Any help will be much appreciated. >> >> >> >> Colin >> >> >> >> -- >> >> ubuntu-users mailing list >> >> ubuntu-users@... >> <mailto:ubuntu-users@...> >> >> Modify settings or unsubscribe at: >> >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users >> > >> > >> >> -- >> ubuntu-users mailing list >> ubuntu-users@... >> <mailto:ubuntu-users@...> >> Modify settings or unsubscribe at: >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users >> >> >> > -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding password* Colin Law <clanlaw@...> [2009-11-06 21:46 +0000]:
> I can shut down a remote machine by connecting via ssh then shutting it down > ssh ip_address > <logon messages> > sudo shutdown -h now > password: (entered pwd not visible) > > and the remote machine shuts down. > To save typing (and brain power) I wrote a script on local machine > ssh ip_addr sudo shutdown -h now > When I run the script it works as expected and shuts down the remote > machine, but when it prompts me for the password (for the sudo > shutdown), the password I type is not hidden but is visible on screen, > which is not good. I am sure there is a way round this but I have not > managed to find it. Any help will be much appreciated. Having looked at some of the other replies, if a password-less solution really interests you... You could setup password-less invocation of sudo for shutdown by adding an entry such as the following to sudoers on the remote host. youruser ALL = NOPASSWD: /sbin/shutdown Alternatively, you could invoke the shutdown command directly as root by setting up ssh keys for root and enabling root login for forced commands only in sshd_config on the remote host. PermitRootLogin forced-commands-only See sudoers(5) and sshd_config(5). -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordFound this on commandlinefu.com
stty -echo; ssh HOSTNAME "sudo some_command"; stty echo See if it does what you need. Matt Colin Law wrote: > 2009/11/6 Matt Brown <mbrown7776@...>: > >> Change sudo to NOPASSWD >> >> You can get dangerous with sudo... >> > > I see that I can do that, but I don't like it. It is not entering the > password that is the problem, it is that the pwd is not hidden when I > type it. > > Colin > > >> Matt >> >> Brent Bolin wrote: >> >>> Think there is also an option in sudo to not prompt for passwd >>> >>> On Fri, Nov 6, 2009 at 4:03 PM, Brent Bolin <brent.bolin@... >>> <mailto:brent.bolin@...>> wrote: >>> >>> As root >>> >>> >>> On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@... >>> <mailto:clanlaw@...>> wrote: >>> >>> 2009/11/6 Brent Bolin <brent.bolin@... >>> <mailto:brent.bolin@...>>: >>> > Use ssh keys >>> >>> If I understand you correctly you mean that I should use keys to >>> prevent the necessity for entering the password at all. In fact I >>> already do this. The password is not for the ssh connection >>> but for >>> the sudo shutdown command. How can I use ssh keys to prevent >>> having >>> to enter pwd for sudo? >>> >>> Colin >>> >>> > >>> > On Fri, Nov 6, 2009 at 3:46 PM, Colin Law >>> <clanlaw@... <mailto:clanlaw@...>> wrote: >>> >> >>> >> I can shut down a remote machine by connecting via ssh then >>> shutting it >>> >> down >>> >> ssh ip_address >>> >> <logon messages> >>> >> sudo shutdown -h now >>> >> password: (entered pwd not visible) >>> >> >>> >> and the remote machine shuts down. >>> >> To save typing (and brain power) I wrote a script on local >>> machine >>> >> ssh ip_addr sudo shutdown -h now >>> >> When I run the script it works as expected and shuts down >>> the remote >>> >> machine, but when it prompts me for the password (for the sudo >>> >> shutdown), the password I type is not hidden but is visible >>> on screen, >>> >> which is not good. I am sure there is a way round this but >>> I have not >>> >> managed to find it. Any help will be much appreciated. >>> >> >>> >> Colin >>> >> >>> >> -- >>> >> ubuntu-users mailing list >>> >> ubuntu-users@... >>> <mailto:ubuntu-users@...> >>> >> Modify settings or unsubscribe at: >>> >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users >>> > >>> > >>> >>> -- >>> ubuntu-users mailing list >>> ubuntu-users@... >>> <mailto:ubuntu-users@...> >>> Modify settings or unsubscribe at: >>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users >>> >>> >>> >>> > > -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Fri, 2009-11-06 at 21:46 +0000, Colin Law wrote:
> When I run the script it works as expected and shuts down the remote > machine, but when it prompts me for the password (for the sudo > shutdown), the password I type is not hidden but is visible on screen, > which is not good. I am sure there is a way round this but I have not > managed to find it. Any help will be much appreciated. https://wiki.ubuntu.com/SecurityTeam/FAQ#SSH Marc. -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Fri, Nov 06, 2009 at 21:46 +0000, Colin Law wrote:
> I can shut down a remote machine by connecting via ssh then shutting it down > ssh ip_address > <logon messages> > sudo shutdown -h now > password: (entered pwd not visible) Did you ry the -t flag to ssh like this: % ssh -t REMOTE sudo echo murx [sudo] password for bsb: Sorry, try again. [sudo] password for bsb: murx Connection to REMOTE closed. % Sorry that I don't shutdown that machine ;) And yes, I'm always using ssh keys. HTH Siggy -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Fri, Nov 06, 2009 at 09:59:27PM +0000, Colin Law wrote:
> How can I use ssh keys to prevent having to enter pwd for sudo? Root does not need sudo. So make sure the remote system has a functional root accout: sudo passwd root then on the local system ssh-copy-id root@... -- Hal -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding password2009/11/6 Matt Brown <mbrown7776@...>:
> Found this on commandlinefu.com > > stty -echo; ssh HOSTNAME "sudo some_command"; stty echo > > See if it does what you need. > Yes, that does work, and thanks for pointing out a useful website I was unaware of. Marc Deslauriers has pointed me to a even better solution (see later email). Colin -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding password2009/11/6 Marc Deslauriers <marcdeslauriers@...>:
> On Fri, 2009-11-06 at 21:46 +0000, Colin Law wrote: >> When I run the script it works as expected and shuts down the remote >> machine, but when it prompts me for the password (for the sudo >> shutdown), the password I type is not hidden but is visible on screen, >> which is not good. I am sure there is a way round this but I have not >> managed to find it. Any help will be much appreciated. > > > https://wiki.ubuntu.com/SecurityTeam/FAQ#SSH Thanks for pointing me to the FAQ Marc, the solution there works perfectly ssh -t <ip> sudo shutdown -h now It's the -t that does it. Thanks to all who responded Colin -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Fri, Nov 6, 2009 at 8:44 PM, Hal Burgiss <hal@...> wrote:
> On Fri, Nov 06, 2009 at 09:59:27PM +0000, Colin Law wrote: >> How can I use ssh keys to prevent having to enter pwd for sudo? > Root does not need sudo. So make sure the remote system has a functional root > accout: Please don't recommend something like this unless you explain what you are doing and why... and > ssh-copy-id root@... You can do that without ever putting a password on root - in other words if that was what he wanted (which it wasn't) he could allow logging into root via ssh key without allowing login to root via password. Brian (the OP has found ssh -t which is what he needed) -- All you need to know about Ubuntu 9.04 Jaunty -> gconftool -s --type bool /apps/update-notifier/auto_launch false -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Sun, Nov 8, 2009 at 4:55 PM, Brian McKee <brian.mckee@...> wrote:
> On Fri, Nov 6, 2009 at 8:44 PM, Hal Burgiss <hal@...> wrote: >> On Fri, Nov 06, 2009 at 09:59:27PM +0000, Colin Law wrote: >>> How can I use ssh keys to prevent having to enter pwd for sudo? >> Root does not need sudo. So make sure the remote system has a functional root >> accout: > > Please don't recommend something like this unless you explain what you > are doing and why... and I thought it was obvious, but since you asked nicely, I'll explain: Logging in repetively to any system is *much* easier using keys as opposed to passwords. It certainly would simplify this operation and is exactly how I would do it. So if you set up the root account on the remote system's authorized_keys with your personal keys, you can login as root and no password is required for anything (the login or the sudo prompt) at that point. Voila! -- Hal -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding password2009/11/6 Siggy Brentrup <bsb@...>:
> On Fri, Nov 06, 2009 at 21:46 +0000, Colin Law wrote: >> I can shut down a remote machine by connecting via ssh then shutting it down >> ssh ip_address >> <logon messages> >> sudo shutdown -h now >> password: (entered pwd not visible) > > Did you ry the -t flag to ssh like this: Yes, you must have missed an earlier reply, that worked perfectly for me, thanks Colin > > % ssh -t REMOTE sudo echo murx > [sudo] password for bsb: > Sorry, try again. > [sudo] password for bsb: > murx > Connection to REMOTE closed. > % > > Sorry that I don't shutdown that machine ;) And yes, I'm always using > ssh keys. > > HTH > Siggy > > -- > ubuntu-users mailing list > ubuntu-users@... > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users > -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Sun, Nov 8, 2009 at 10:01 PM, Hal Burgiss <hal@...> wrote:
> On Sun, Nov 8, 2009 at 4:55 PM, Brian McKee <brian.mckee@...> wrote: >> On Fri, Nov 6, 2009 at 8:44 PM, Hal Burgiss <hal@...> wrote: >>> On Fri, Nov 06, 2009 at 09:59:27PM +0000, Colin Law wrote: >>>> How can I use ssh keys to prevent having to enter pwd for sudo? >>> Root does not need sudo. So make sure the remote system has a functional root >>> accout: >> >> Please don't recommend something like this unless you explain what you >> are doing and why... and > > I thought it was obvious, but since you asked nicely, I'll explain: I thought it was obvious, but I'll say it again. You do not need to put a password on the root account to use it with an ssh key. Don't recommend doing so without at least acknowledging that's not the way this distro was planned to be used. Brian -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
|
|
Re: ssh and remote sudo not hiding passwordOn Thu, Nov 12, 2009 at 10:12:54AM -0500, Brian McKee wrote:
> > Don't recommend doing so without at least acknowledging that's not the > way this distro was planned to be used. And who are you to tell me what I can recommend and what I can't? If this is your list, pull the plug on me. If not, shove it. Sideways. I don't much care how "the way the distro was planned to be used", I was not on the planning committee and did not sign on the dotted line or take the pledge. -- Hal -- ubuntu-users mailing list ubuntu-users@... Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |