Tagged Questions

1
vote
1answer
132 views

How do I execute a remote shell script over SSH and be prompted for passwords by commands that require it in that script?

I want to do something like this ssh [email protected] ./remote_script.sh Contents of remote_script.sh #!/bin/bash hg pull This example is much simpler than what I am actually doing. I know ...
1
vote
3answers
48 views

Execute a command on multiple hosts, but only print command if it is successful?

Here's what I want to do. I want to check over 100 hosts and see if a file exists on that host. If the file does exist, then I want to print the hostname and the output of the command. In this ...
2
votes
1answer
67 views

How to script a database migration using SSH?

I am trying to create a sync.sh script that coordinates with our less-than-ideal version control for our website. This script will migrate a copy of the live database to our local development ...
3
votes
3answers
198 views

How to write a bash script, that logs onto an other machine to do stuff?

Is it possible to write a bash script, that would be started from machine A, logs in on a different machine B by ssh (both machines A and B would be Linux-Machines), copys some files on to machine B ...
1
vote
2answers
111 views

How to change user with authentication inside shell script

It is possible to change the user within a shell script by su - newuser; but what if the newuser needs authentication. How can I provide the password within the shell script? None of the users is ...
0
votes
2answers
155 views

Automated SSH Login [closed]

Possible Duplicate: Shell Script for logging into a ssh server Autentification on SSH connection in OneLine How could I make a SSH Login programmatically on a unix server, I don't have ...
0
votes
2answers
73 views

Autentification on SSH connection in OneLine [closed]

Possible Duplicate: Shell Script for logging into a ssh server I need to connect via SSH to a remote server, however I must do this with out interactive mode and with out use Public keys ...
2
votes
3answers
151 views

Keep running a script via ssh

ssh can use to run remote commands. ssh [email protected] 'long-script.sh' I run a long script that will take a lot of time, but I want to close my computer and keep running the script in the remote ...
3
votes
1answer
190 views

wait for autossh connection to complete

I'm trying to create a script that runs a few commands that take a long time to execute and require a constant connection, but autossh user@server wait $! #or wait ${!} commandA commandB doesn't ...
5
votes
4answers
1k views

How to delete a file on remote machine via SSH by using a Shell Script?

I am writing a Shell Script where I have to delete a file on a remote machine via a Shell Script. Flow manually: ssh [email protected] .. then at domain: cd ./some/where rm ...
1
vote
3answers
267 views

How do i execute a remote script with 'screens'?

I need to execute a script locally. The problem is, it needs to use screen and send the ctrl d command. How would i do this? The script will be on my local windows machine. i can use winscp, putty, ...
3
votes
4answers
595 views

How can I detect if the shell is controlled from SSH?

I want to detect from a shell script (more specifically .zshrc) if it is controlled through SSH. I tried the HOST variable but it's always the name of the computer which is running the shell. Can I ...
6
votes
4answers
430 views

Why do I need to hit enter to get my shell prompt after my init.d script completes?

I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656. But there's a ...