ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
It's in the package "openssh-client-1:4.7p1-8ubuntu1.2" in Ubuntu.
If you don't have it, then you might just write a shell script of your own to do the copy. Here's what's in the official ssh-copy-id (link).
I think your original problem is that you are using the pipe as if spawn is a shell command, and thinking expect has the same functions. Expect is not like a shell script interpreter - it uses a language called TCL. AFAIK, TCL has no concept of pipes and re-direction (at least not in the same way that shell scripting does).
mmm... I was doing that exactly assuming expect as a bash like interpreter, but then I have a problem, see the point is to get this script run as a postinstallation process in order to allow them automatically to ssh without password to the server at the end of installation and ask the pull some files from the server automatically, cant use netcat since netcat only allow for a single connection at a time right??
What could I try in order to achieve this!?
I have not tried spawning ssh-copy-id but ill try tonight or tomorrow.
To pull some files down from a server on the net somewhere, you don't need to use ssh/expect at all - why not just use curl or wget or something which can pull files using HTTP/HTTPS or FTP?
All these protocols can use password authentication if you want the files to only be available to your customers, and if you want to keep the transfer from being snoopable by third parties who share a network with you, use HTTPS.