Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to make the following steps into one single unix command ?

30 views
Skip to first unread message

chun...@gmail.com

unread,
Nov 15, 2012, 1:15:59 AM11/15/12
to
Hi all,
These are the commands I need to run everyday once I login in a linux box in csh.
1. type "server.sh" and press "enter" key.
2. The staring script will pop up a message asking for password.
3. manually enter the pwd, such as "aaabbb", then the script will continue running till it is fully started.

For the above 3 steps, is there a way I can make it as a one line command ? Either to save the password in some file or to feed the password to this "server.sh" ?

Thanks a lot

John



Message has been deleted

Thomas 'PointedEars' Lahn

unread,
Nov 15, 2012, 7:14:10 AM11/15/12
to
Michael Vilain wrote:
> Entering a password requires using a utility called expect. Start
> reading the documentation there. You should be able to come up with a
> script in short order.

Depending on what server.sh does, and what the location and importance of
the server being connected to is, it is probably easier and safer to use
authentication keys for the target server that are not passphrase-protected.

I would recommend connecting to that server using SSH v2 and a 2048+ bit RSA
key, a [1024 bit] DSA key [AFAIK ssh-keygen(1) cannot do better], or a 384+
bit EC-DSA key for the time being.

--
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Christian Weisgerber

unread,
Nov 15, 2012, 10:51:29 AM11/15/12
to
Thomas 'PointedEars' Lahn <use...@PointedEars.de> wrote:

> a [1024 bit] DSA key [AFAIK ssh-keygen(1) cannot do better],

... because older versions of FIPS 186 didn't allow longer DSA keys.

--
Christian "naddy" Weisgerber na...@mips.inka.de

Thomas 'PointedEars' Lahn

unread,
Nov 15, 2012, 7:13:25 PM11/15/12
to
Christian Weisgerber wrote:

> Thomas 'PointedEars' Lahn <use...@PointedEars.de> wrote:
>> a [1024 bit] DSA key [AFAIK ssh-keygen(1) cannot do better],
>
> ... because older versions of FIPS 186 didn't allow longer DSA keys.

Exactly.

#v+
SSH-KEYGEN(1) BSD General Commands Manual SSH-KEYGEN(1)
[…]
-b bits
Specifies the number of bits in the key to create. For RSA
keys, the minimum size is 768 bits and the default is 2048
bits. Generally, 2048 bits is considered sufficient. DSA keys
must be exactly 1024 bits as specified by FIPS 186-2. For
ECDSA keys, the -b flag determines the key length by selecting
from one of three elliptic curve sizes: 256, 384 or 521 bits.
Attempting to use bit lengths other than these three values for
ECDSA keys will fail.
[…]
BSD November 15, 2012 BSD
#v-

(BTW, that is from Debian GNU/Linux.)
0 new messages