FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-06-2009, 08:56 PM
Brent Bolin
 
Default ssh and remote sudo not hiding password

Use ssh keys

On Fri, Nov 6, 2009 at 3:46 PM, Colin Law <clanlaw@googlemail.com> 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@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 08:56 PM
Matt Brown
 
Default ssh and remote sudo not hiding password

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)
>
> 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
>
>
Use ssh keys much nicer then you don't have to have a password.

Matt

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 08:59 PM
Colin Law
 
Default ssh and remote sudo not hiding password

2009/11/6 Brent Bolin <brent.bolin@gmail.com>:
> 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@googlemail.com> 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@lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:03 PM
Brent Bolin
 
Default ssh and remote sudo not hiding password

As root

On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@googlemail.com> wrote:

2009/11/6 Brent Bolin <brent.bolin@gmail.com>:

> 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@googlemail.com> 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@lists.ubuntu.com

>> Modify settings or unsubscribe at:

>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

>

>



--

ubuntu-users mailing list

ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:04 PM
Brent Bolin
 
Default ssh and remote sudo not hiding password

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@gmail.com> wrote:

As root

On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@googlemail.com> wrote:


2009/11/6 Brent Bolin <brent.bolin@gmail.com>:

> 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@googlemail.com> 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@lists.ubuntu.com

>> Modify settings or unsubscribe at:

>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

>

>



--

ubuntu-users mailing list

ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users





--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:14 PM
Matt Brown
 
Default ssh and remote sudo not hiding password

Change 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@gmail.com
> <mailto:brent.bolin@gmail.com>> wrote:
>
> As root
>
>
> On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@googlemail.com
> <mailto:clanlaw@googlemail.com>> wrote:
>
> 2009/11/6 Brent Bolin <brent.bolin@gmail.com
> <mailto:brent.bolin@gmail.com>>:
> > 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@googlemail.com <mailto:clanlaw@googlemail.com>> 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@lists.ubuntu.com
> <mailto:ubuntu-users@lists.ubuntu.com>
> >> Modify settings or unsubscribe at:
> >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> >
> >
>
> --
> ubuntu-users mailing list
> ubuntu-users@lists.ubuntu.com
> <mailto:ubuntu-users@lists.ubuntu.com>
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
>

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:30 PM
Colin Law
 
Default ssh and remote sudo not hiding password

2009/11/6 Matt Brown <mbrown7776@gmail.com>:
> 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@gmail.com
>> <mailto:brent.bolin@gmail.com>> wrote:
>>
>> * *As root
>>
>>
>> * *On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@googlemail.com
>> * *<mailto:clanlaw@googlemail.com>> wrote:
>>
>> * * * *2009/11/6 Brent Bolin <brent.bolin@gmail.com
>> * * * *<mailto:brent.bolin@gmail.com>>:
>> * * * *> 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@googlemail.com <mailto:clanlaw@googlemail.com>> 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@lists.ubuntu.com
>> * * * *<mailto:ubuntu-users@lists.ubuntu.com>
>> * * * *>> Modify settings or unsubscribe at:
>> * * * *>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>> * * * *>
>> * * * *>
>>
>> * * * *--
>> * * * *ubuntu-users mailing list
>> * * * *ubuntu-users@lists.ubuntu.com
>> * * * *<mailto:ubuntu-users@lists.ubuntu.com>
>> * * * *Modify settings or unsubscribe at:
>> * * * *https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>
>>
>>
>

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:33 PM
James Michael Fultz
 
Default ssh and remote sudo not hiding password

* Colin Law <clanlaw@googlemail.com> [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@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:36 PM
Matt Brown
 
Default ssh and remote sudo not hiding password

Found 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@gmail.com>:
>
>> 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@gmail.com
>>> <mailto:brent.bolin@gmail.com>> wrote:
>>>
>>> As root
>>>
>>>
>>> On Fri, Nov 6, 2009 at 3:59 PM, Colin Law <clanlaw@googlemail.com
>>> <mailto:clanlaw@googlemail.com>> wrote:
>>>
>>> 2009/11/6 Brent Bolin <brent.bolin@gmail.com
>>> <mailto:brent.bolin@gmail.com>>:
>>> > 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@googlemail.com <mailto:clanlaw@googlemail.com>> 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@lists.ubuntu.com
>>> <mailto:ubuntu-users@lists.ubuntu.com>
>>> >> Modify settings or unsubscribe at:
>>> >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>> >
>>> >
>>>
>>> --
>>> ubuntu-users mailing list
>>> ubuntu-users@lists.ubuntu.com
>>> <mailto:ubuntu-users@lists.ubuntu.com>
>>> Modify settings or unsubscribe at:
>>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>>
>>>
>>>
>>>
>
>

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-06-2009, 09:38 PM
Marc Deslauriers
 
Default ssh and remote sudo not hiding password

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

Marc.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 02:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org