Skip to main content

All Questions

Tagged with
1 vote
1 answer
7k views

How do I get my expect statement to not output the stdout of the first command?

What I'm trying to do is execute an ssh command that prints out the /etc/shadow file. Obviously that file requires root or sudo permission, and I don't have root creds, therefore I have to use sudo. ...
beechfuzz's user avatar
0 votes
1 answer
1k views

How to toggle outlet power to Eaton ePDU G3 from shell script

I'm trying to programmatically toggle power to several outlets on a Eaton ePDU G3 using ssh via Jenkins CI shell script. This is to fire up lidars only during a Jenkins run. It is not clear how to do ...
Dennis Hoer's user avatar
0 votes
1 answer
65 views

Expect not exiting non-zero

My real goal is to have a script that will run locally to ssh into a remote server, restart tomcat, and use expect to wait for the "Server startup in" message, or exit non-zero if it sees startup ...
Dave's user avatar
  • 123
1 vote
1 answer
469 views

Automating SSH login gives unresponsive remote-shell, dropping back to client-terminal (without errors)

I have a problem with the tool expect under Ubuntu 14.04 LTS. I want to automate ssh logins to some Sophos UTM Firewalls and evelate my rights directly after with "sudo su -" and the correct password. ...
Nyctophilia's user avatar
2 votes
1 answer
2k views

How can I set up nautilus to use a ssh connection established by an expect script?

In order to automate a ssh connection, I wrote a script using expect, which works just fine. However, I would like to use this script in the nautilus connect to server function. My idea was to include ...
Daniel Förster's user avatar
4 votes
3 answers
8k views

Automating an ssh connection with crontab

I've been struggling to crontab automate a git push process with ssh, and it's proving tricky to setup a key with the ssh agent. Starting with a basic script to test the agent: # set paths (all ...
geotheory's user avatar
  • 1,089
2 votes
1 answer
7k views

expect command in ubuntu

I've searched all over SuperUser, but couldn't get the solution. Here is a script that am using for ssh using expect. I'm using ubuntu and I've installed expect using aptitude install expect. #!/usr/...
CodZilla's user avatar
0 votes
3 answers
4k views

Linux: ssh command works outside bash script, but not within script?

I am having problem with the following command: echo "Pass for router:" read -s pass /usr/bin/expect - << EXPCT spawn ssh 192.168.10.1 -l root 'opkg list-installed' > list-installed.txt #...
FernandoSBS's user avatar
  • 2,003
0 votes
3 answers
16k views

how to run a local script in remote server using expect and bash script

I want to make a script that will connect to a server and do some CRUD operation on the server and again return to local. I do not want to upload the script to server.. I have made a script that ...
user1760929's user avatar
0 votes
1 answer
3k views

SSH + Sudo + Expect in Bash script: Run command with sudo in remote machine

I am trying to automate the deploy of some .deb packages with an script. I want to execute sudo dpkg -i $myDeb.deb in a list of remote machines I can access with ssh. I've tried to automate the ...
Savir's user avatar
  • 117
1 vote
1 answer
2k views

Why doesn't redirect work for scp password input?

I want to copy from remote box with scp, while the fact that each time I have to re-enter password is annoying. So I store my password in plain text and expect the following code should work scp -...
Summer_More_More_Tea's user avatar
1 vote
1 answer
566 views

Can the expect utility handle a case where the process it spawns also spawns a sub process?

I'm trying to use expect to handle rsync over an ssh shell, but it gets stuck. If I run my rsync command it works (simplified here): It prompts me for my password and copies files to the server: ...
davidparks21's user avatar
  • 1,612