How do I pass a password in a kermit script - Protocols

This is a discussion on How do I pass a password in a kermit script - Protocols ; I have a kermit script that logs onto a secure ftp server (via ssh), when I issue the open command, it waits for a password. How can I pass this password from within the kermit script, so it automatically logs ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: How do I pass a password in a kermit script

  1. How do I pass a password in a kermit script

    I have a kermit script that logs onto a secure ftp server (via ssh),
    when I issue the open command, it waits for a password.

    How can I pass this password from within the kermit script, so it
    automatically logs me on ?

    Also, is there a way to check if I cannot make a connection ?


    Thanks.

  2. Re: How do I pass a password in a kermit script

    In article ,
    newexpectuser wrote:
    : I have a kermit script that logs onto a secure ftp server (via ssh),
    : when I issue the open command, it waits for a password.
    :
    : How can I pass this password from within the kermit script, so it
    : automatically logs me on ?
    :
    : Also, is there a way to check if I cannot make a connection ?
    :
    Last first: Only by trying it.

    As to the password, see:

    http://www.columbia.edu/kermit/ckermit80.html#x2.1

    Briefly, SSH is an "external transport protocol" to C-Kermit. It is the
    external SSH program that is prompting you for the password, and there is
    usually no way to script it; it depends on the SSH client. The only sure
    way to avoid a password prompt is to set up public-private key pairs to
    allow login without a password, but this has its own risks.

    - Frank

  3. Re: How do I pass a password in a kermit script

    in comp.protocols.kermit.misc i read:

    >Briefly, SSH is an "external transport protocol" to C-Kermit. It is the
    >external SSH program that is prompting you for the password,

    [...]
    >The only sure way to avoid a password prompt is to set up public-private
    >key pairs to allow login without a password, but this has its own risks.


    another way is to make use of the agent.

    --
    a signature

  4. Re: How do I pass a password in a kermit script

    An agent of SSH or Kermit ?...I've never heard of an agent
    those who know me have no need of my name wrote in message news:...
    > in comp.protocols.kermit.misc i read:
    >
    > >Briefly, SSH is an "external transport protocol" to C-Kermit. It is the
    > >external SSH program that is prompting you for the password,

    > [...]
    > >The only sure way to avoid a password prompt is to set up public-private
    > >key pairs to allow login without a password, but this has its own risks.

    >
    > another way is to make use of the agent.


  5. Re: How do I pass a password in a kermit script

    in comp.protocols.kermit.misc i read:
    >those who know me have no need of my name
    >wrote in message news:...
    >> in comp.protocols.kermit.misc i read:


    >> >The only sure way to avoid a password prompt is to set up public-private
    >> >key pairs to allow login without a password, but this has its own risks.

    >>
    >> another way is to make use of the agent.


    >An agent of SSH or Kermit ?...I've never heard of an agent


    ssh.

    --
    a signature

  6. Re: How do I pass a password in a kermit script

    those who know me have no need of my name wrote:
    : in comp.protocols.kermit.misc i read:

    :>Briefly, SSH is an "external transport protocol" to C-Kermit. It is the
    :>external SSH program that is prompting you for the password,
    : [...]
    :>The only sure way to avoid a password prompt is to set up public-private
    :>key pairs to allow login without a password, but this has its own risks.

    : another way is to make use of the agent.

    ssh-agent requires the use of public-private key pairs. However,
    public-private key pairs are safer to use than passwords in every
    case because a password is easier to steal and transport between
    systems.

    A properly password protected private key file preloaded into the
    ssh-agent will provide stronger security than the embedding of a
    password in a script.


  7. Re: How do I pass a password in a kermit script

    We just want to use a password passed from a kermit script instead of using keys.

  8. Re: How do I pass a password in a kermit script

    In article ,
    newexpectuser wrote:
    : We just want to use a password passed from a kermit script instead of
    : using keys.
    :
    See:

    ftp://kermit.columbia.edu/kermit/scr...kermit/autossh

    You'll have to experiment with it. I don't recall the details but I'm
    pretty sure I concluded it was impossible for Kermit to respond to the
    ssh client's password prompt. See the comments in the script.

    The difficulty, of course, comes because SSH is external, rather than
    built in, to C-Kermit. If you were using Windows, you could use Kermit 95
    instead, which has a built-in scriptable SSH client.

    - Frank

  9. Re: How do I pass a password in a kermit script

    On 3 Nov 2003, newexpectuser wrote:

    > We just want to use a password passed from a kermit script instead of using keys.
    >


    I don't know if this helps or not, but this is what I do with C-Kermit
    8.0.209 on FreeBSD Unix.

    \m(rhost) and \m(rdomain) are set earlier in the script.

    ....
    assign pswd1 not
    assign pswd2 equal
    while not equal {\m(pswd1)} {\m(pswd2)} {
    askq pswd1 {Password for \v(userid) on \m(rhost):}
    askq pswd2 {Reenter to confirm:}
    }
    set host /pty ssh -e none -l \v(userid) \m(rhost).\m(rdomain)
    if fail end 1 Unable to connect to \m(rhost).
    input 20 assword:
    if fail end 1 No password prompt.
    output \m(pswd1)\13
    ....

    The input and output statements see the password prompt from ssh
    and supply the password. It works in my situation.

    Of course the password, host info and userid can be supplied in
    many different ways to the script.

    --
    Mark Sapiro The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan


  10. Re: How do I pass a password in a kermit script

    in comp.protocols.kermit.misc i read:

    > ftp://kermit.columbia.edu/kermit/scr...kermit/autossh
    >
    >You'll have to experiment with it. I don't recall the details but I'm
    >pretty sure I concluded it was impossible for Kermit to respond to the
    >ssh client's password prompt. See the comments in the script.


    it should be possible, provided that c-kermit runs ssh in a pty
    environment, as ssh just uses /dev/tty (often via getpass() or it's kin).

    --
    a signature

  11. Re: How do I pass a password in a kermit script

    I don't think though that any version of Kermit can automatically
    delete a file it just transfered successfully though ?
    Mark Sapiro wrote in message news:...
    > On 3 Nov 2003, newexpectuser wrote:
    >
    > > We just want to use a password passed from a kermit script instead of using keys.
    > >

    >
    > I don't know if this helps or not, but this is what I do with C-Kermit
    > 8.0.209 on FreeBSD Unix.
    >
    > \m(rhost) and \m(rdomain) are set earlier in the script.
    >
    > ...
    > assign pswd1 not
    > assign pswd2 equal
    > while not equal {\m(pswd1)} {\m(pswd2)} {
    > askq pswd1 {Password for \v(userid) on \m(rhost):}
    > askq pswd2 {Reenter to confirm:}
    > }
    > set host /pty ssh -e none -l \v(userid) \m(rhost).\m(rdomain)
    > if fail end 1 Unable to connect to \m(rhost).
    > input 20 assword:
    > if fail end 1 No password prompt.
    > output \m(pswd1)\13
    > ...
    >
    > The input and output statements see the password prompt from ssh
    > and supply the password. It works in my situation.
    >
    > Of course the password, host info and userid can be supplied in
    > many different ways to the script.


  12. Re: How do I pass a password in a kermit script

    newexpectuser wrote:
    : I don't think though that any version of Kermit can automatically
    : delete a file it just transfered successfully though ?

    I have no idea what this has to do with passing a string to a SSH
    process running in a PTY but the command you are looking for is

    send /delete


  13. Re: How do I pass a password in a kermit script

    those who know me have no need of my name wrote:
    : in comp.protocols.kermit.misc i read:

    :> ftp://kermit.columbia.edu/kermit/scr...kermit/autossh
    :>
    :>You'll have to experiment with it. I don't recall the details but I'm
    :>pretty sure I concluded it was impossible for Kermit to respond to the
    :>ssh client's password prompt. See the comments in the script.

    : it should be possible, provided that c-kermit runs ssh in a pty
    : environment, as ssh just uses /dev/tty (often via getpass() or it's kin).

    Of course C-Kermit can send the password to the SSH client, this could
    be done either as part of the script or as part of the built in command.
    It just that neither is being done at the current time. The point the
    comment in the script is supposed to make is that since K95 has OpenSSH
    built into the program it is able to automate the use of the password
    in ways which the PTY support in C-Kermit cannot. (For example, know
    to use a password as the key to access a private key file, or as input
    to obtain a Kerberos credential, or as input to one of the many auth
    types which require a password.

    The reason it is hard in a generic script to handle all of these cases
    is that it requires time to research all of the possible prompts.
    Clearly, the author of the script did not take this time. Members of
    the Kermit community are welcome to perform modifications and contribute
    updates.

    --
    Jeffrey Altman * Volunteer Developer Kermit 95 2.1 GUI available now!!!
    The Kermit Project @ Columbia University SSH, Secure Telnet, Secure FTP, HTTP
    http://www.kermit-project.org/ Secured with MIT Kerberos, SRP, and
    kermit-support@columbia.edu OpenSSL.

  14. Re: How do I pass a password in a kermit script

    In article ,
    newexpectuser wrote:
    : I don't think though that any version of Kermit can automatically
    : delete a file it just transfered successfully though ?
    :
    Something seems to be wrong with our news server. The original copy of the
    following post never showed up... Anyway, as the the above -- as Jeff said,
    yes, of course Kermit can do that. For much more about Kermit's capabilities
    in this area ("atomic file movement" or "transaction processing"), see:

    http://www.columbia.edu/kermit/case10.html

    and (as an ftp client):

    http://www.columbia.edu/kermit/ftpscripts.html

    : Mark Sapiro wrote in
    : message news:...
    :> On 3 Nov 2003, newexpectuser wrote:
    :> ...
    :> I don't know if this helps or not, but this is what I do with C-Kermit
    :> 8.0.209 on FreeBSD Unix.
    :>
    :> \m(rhost) and \m(rdomain) are set earlier in the script.
    :> ...
    :> assign pswd1 not
    :> assign pswd2 equal
    :> while not equal {\m(pswd1)} {\m(pswd2)} {
    :> askq pswd1 {Password for \v(userid) on \m(rhost):}
    :> askq pswd2 {Reenter to confirm:}
    :> }
    :> set host /pty ssh -e none -l \v(userid) \m(rhost).\m(rdomain)
    :> if fail end 1 Unable to connect to \m(rhost).
    :> input 20 assword:
    :> if fail end 1 No password prompt.
    :> output \m(pswd1)\13
    :> ...
    :>
    :> The input and output statements see the password prompt from ssh
    :> and supply the password. It works in my situation.
    :
    Right, this would be one way to do it, if it can be done. But it might also
    be the case that an ssh client does not use /dev/tty when prompting for the
    password. If yours does, fine. If not, scripting the interaction will
    be a challenge.

    In any case, as Jeff says, the scripts in the script library are examples,
    samples to be taken as starting points. Readers have always been welcome to
    make contributions. The invitation still stands.

    - Frank

  15. Re: How do I pass a password in a kermit script

    If anybody is interested, I use EXPECT to spawn a Kermit session, this
    way I can pass a password.
    Frank da Cruz wrote in message news:...
    > In article ,
    > newexpectuser wrote:
    > : I don't think though that any version of Kermit can automatically
    > : delete a file it just transfered successfully though ?
    > :
    > Something seems to be wrong with our news server. The original copy of the
    > following post never showed up... Anyway, as the the above -- as Jeff said,
    > yes, of course Kermit can do that. For much more about Kermit's capabilities
    > in this area ("atomic file movement" or "transaction processing"), see:
    >
    > http://www.columbia.edu/kermit/case10.html
    >
    > and (as an ftp client):
    >
    > http://www.columbia.edu/kermit/ftpscripts.html
    >
    > : Mark Sapiro wrote in
    > : message news:...
    > :> On 3 Nov 2003, newexpectuser wrote:
    > :> ...
    > :> I don't know if this helps or not, but this is what I do with C-Kermit
    > :> 8.0.209 on FreeBSD Unix.
    > :>
    > :> \m(rhost) and \m(rdomain) are set earlier in the script.
    > :> ...
    > :> assign pswd1 not
    > :> assign pswd2 equal
    > :> while not equal {\m(pswd1)} {\m(pswd2)} {
    > :> askq pswd1 {Password for \v(userid) on \m(rhost):}
    > :> askq pswd2 {Reenter to confirm:}
    > :> }
    > :> set host /pty ssh -e none -l \v(userid) \m(rhost).\m(rdomain)
    > :> if fail end 1 Unable to connect to \m(rhost).
    > :> input 20 assword:
    > :> if fail end 1 No password prompt.
    > :> output \m(pswd1)\13
    > :> ...
    > :>
    > :> The input and output statements see the password prompt from ssh
    > :> and supply the password. It works in my situation.
    > :
    > Right, this would be one way to do it, if it can be done. But it might also
    > be the case that an ssh client does not use /dev/tty when prompting for the
    > password. If yours does, fine. If not, scripting the interaction will
    > be a challenge.
    >
    > In any case, as Jeff says, the scripts in the script library are examples,
    > samples to be taken as starting points. Readers have always been welcome to
    > make contributions. The invitation still stands.
    >
    > - Frank


+ Reply to Thread