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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.