ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
to, obviously, write an ntfsclone image to a partition.
I would like this script to only ask for the ssh password once, then pass it to both ssh commands, and the only way I can find to do this is with "expect".
But the problem is that both ssh commands need to return data to the shell. The first redirects the ls listing to a temp file, and the second pipes the output to gunzip and ntfsclone.
While you could put the password in you're violating the benefit of ssh by having to store your password in clear text. Why not instead set up an ssh trust so that when ssh logs in it doesn't ask for the password at all?
I'd thought you were just doing a machine to machine setup. If you're trying to propagate this out to multiple insecure locations you probably want to have a jail area on your main system for each of the remove locations (that is don't use the same user for every one of them). That would allow them to dump the file to the jail area. You'd then put a process in place on your main system that copied the information out of the jail into an area none of the CD based systems could reach.
Better yet might be doing an ssh FROM the main system to the CD based systems so the security is controlled by the main system and you don't have to worry about compromise of the remotes except as it affects their invidual data.
Thanks for the advice. I'm not too familiar with chroot jails (if that's what you're talking about), so for now, I guess I'll stick to my inelegant-put-your-ssh-password-in-twice setup.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.