Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you're clear-texting the passphrase into the script anyway, why not just skip the middleman and set up a fully passwordless login between the two servers. Then you can just scp like normal without having to use expect.
Last edited by suicidaleggroll; 05-09-2012 at 05:47 PM.
For what it's worth, I have an expect script that does something very similar, but looks quite different. I'm not an expect expert, so I can't really comment on what the differences are, but maybe you could try running it this way to see if you get different results
this is when I am getting the permission denied error . So i tired to just run the script and i have put a -v in the scp , just to see whats going on
#/users/user1/t.sh
here is what a portion of the verbose
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
lost connection
send: spawn id exp6 not open
while executing
"send "remsvrbkp\r""
(file "/users/mpdump/t.sh" line 25)
One possible option would be to use ssh-add to preload the passphrase. I use ssh/scp a lot, and use ssh-add at the start of a session so I don't have to keep typing a pass phrase over and over.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.