I tried that earlier and it didn't work, but then I noticed that my expect for the password prompt was different.
I fixed that and also added the escape character and it worked!
Thanks Corona.
So, on expect, you have to put the exact line that it will be expecting right? Also, anyway to get the exit status of an sftp command within expect?
Also how can I get the next command to wait util the previous command finishes?
---------- Post updated at 11:26 AM ---------- Previous update was at 10:55 AM ----------
Ok. I have one more issue. My files are not completing before it exits. It just cuts off while in the middle of transferring
How can I get my expect script to wait till the mput command is finished? ---------- Post updated at 12:47 PM ---------- Previous update was at 11:26 AM ----------
Ok, i got that piece resolved I just had to set the timeout.
Is there anyway to tell expect to exit if it doesn't get what it expects?
Last edited by markdjones82; 12-15-2010 at 11:16 AM..
Newbie here. My goal is to have the expect script log into the Ubuntu 18.04 server and run two commands (lsb_release -a and ip addr) and eventually pipe the output/results to a file. For now, I would be happy to get this one command or two to run successfully. How to fix this?
#!/usr/bin/expect ... (3 Replies)
I am building FTP Script on my Bluehost VPS Server. I have several and all work great except this one.... I think there are two issues .. One with the command and One with "$" in the password.
#!/bin/sh
HOST=invtransfer@52.44.151.220
USER=invtransfer
PASSWORD=XXX$XXX - $ is real in... (3 Replies)
I have a script that does an SSH into a remote node. It should expect the prompt and send the password.
#!/usr/bin/expect
set user ;
set pass ;
spawn ssh $user@E-Internal
expect {
-re "RSA key fingerprint" {send "yes\r"}
timeout... (1 Reply)
Dear All,
I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Hi there. I've been forced by circumstance to write an expect script to handle password updates on a number of servers. There's a mix of Solaris 8, 9, 10, RedHat and Ubuntu. There's no chance the client will allow us to hook them up to a directory, so we have to make do.
This script is mostly... (0 Replies)
How can I pass password in SSH command without using expect in a shell program.
I don't have expect installed on my Solaris server.
#!/bin/bash
ssh user@hotname (how to supply pass in script?:wall:)
Experts please help its very urgent.
Shrawan Kumar Sahu (4 Replies)
Hello folks
I have a conf file ,say 'pass.conf' ,which is storing ascii password : PASS1111.
I need to encrypt this password once and store it in a file.
I ,then need to write a script which would read this encrypted password and decrypts it.The o/p o this script shud be this decrypted... (8 Replies)
Is there any way to send password in a sh script, to establish a ssh connection with the remote server, without having shared the public key?
The command I'm currently using is in my script is
!#/bin/sh
...
ssh -l user remotehost "ls -l"
I have shared the public key of the local... (3 Replies)
Could someone please help me...I have an expect script. There's a need for a log in during the script and a password is required...right now the password is just a variable in the expect script...what would be the best way to put that in an encrypted flat file and have the expect script pull the... (2 Replies)
Hi,
Does anybody know how to change the password on multiple servers with a script. I have 300 Sun boxes and the password expiry is set to 30 days. Im in a process to build a script using expect. Need a help from an expert who has already done it.
Regards,
Vinod (1 Reply)