Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think the problem is, that SSH tries to open PTY and it does not work on anything else than PTY for security reasons. This won't work well with pexpect.</p> <p>I have another ssh client:</p> <p><a href="http://www.digmia.com/index.php?option=com_content&amp;view=article&amp;id=54:Digmia%20Enterprise%20SSH&amp;Itemid=56" rel="nofollow noreferrer">http://www.digmia.com/index.php?option=com_content&amp;view=article&amp;id=54:Digmia%20Enterprise%20SSH&amp;Itemid=56</a></p> <p>It's open-source, you can use it. What you are trying to do would be more commands, but you don't need expect at all.</p> <ol> <li><p>First install it accordingly to manual, then do something like this:</p></li> <li><p>Run dssh-agent, add the password you need like this:</p> <pre><code>dssh-add -l &lt; passwordfile </code></pre> <ul> <li><p>or if it is a secure machine, i.e. no one else can log in there, this is <em>very</em> important, otherwise this would be a huge security hole:</p> <pre><code>echo "name-of-server;22;root;password;" | dssh-add -l </code></pre></li> <li><p><code>password</code> file would be something like:</p> <pre><code>name-of-server;22;root;password; </code></pre></li> </ul></li> <li><p>And the do something like (replace <code>CONTENTS OF ...</code> with actual content of that file):</p> <pre><code>dssh root@name-of-server -- echo "CONTENTS OF ~/.ssh/identity.pub" &gt; .ssh/authorized_keys \; chmod og-w .ssh .ssh/authorized_keys </code></pre> <ul> <li><p>You can (optionally) do</p> <pre><code>dssh-add -f passwords </code></pre></li> </ul> <p>(make sure no one else is doing all this stuff, otherwise you would have a race condition).</p></li> </ol> <p>Also, pexpect should probably work with dssh itself (so you don't need to use dssh-agent). But using dssh-agent is simpler and safer.</p> <p>Installation manual for DSSH is contained in the tarball.</p> <p>I don't know any simpler way of doing this, OpenSSH ssh-copy-id is very picky about where the password comes from...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload