2
votes
1answer
392 views

Terminate remote process when backgrounded ssh session is terminated

So right now I have a bash script that runs a command on a remote machine using ssh. The machine running the bash script is a Linux machine and the remote machine is a Windows machine running cygwin. ...
2
votes
5answers
2k views

Executing script remotely with “curl | bash” feedback

I'm working on a platform that uses a lot such commands: ssh login@server.com 'curl http://some_server/script.sh | bash' This is really clean and handy to execute scripts remotely, however, I don't ...
-1
votes
2answers
442 views

Bash loop to move directories on a remote host via ssh

I'm trying to figure out a way to perform the following loop on a remote host via ssh. Basically it renames a series of directories to create a rotating backup. But it's local. I want it to work ...
1
vote
3answers
1k views

bash function with ssh

I am just getting into bash for the first time. How would I run a function on the server in this scope? drush status is something only on the server being ssh connected too. #!/bin/bash function ...
3
votes
6answers
834 views

Any clever way to put a password in an SSH key?

My host uses passwords instead of id_rsa's to SSH in. But instead of typing the password everytime, is there a way to put the password in my .ssh/config ? For example: Host gravy_access Hostname ...
3
votes
3answers
3k views

Escaping spaces in a remote path when using rsync over a remote SSH connection

When using SSH to connect rsync to a remote server, how do you escape spaces and such in the remote path? A simple backslash escapes the space for the local bash prompt, but on the remote machine the ...
1
vote
2answers
806 views

Getting a custom .bashrc available in ssh session

Currently, we have quite a lot of shared ssh logins to various servers, and my colleagues wouldn't like it if I fiddled with the default shell to much. I do however have quite a list of aliases and ...
6
votes
5answers
11k views

Check to see if a directory exists remotely (shell script)

Is there a way to see if a directory exists on a remote server? Perhaps there's a better way, but I'm writing an application deployment script, and I want to create a directory on a remote server if ...
1
vote
4answers
976 views

Securing bash scripts

Does anybody know what is the best way to secure bash scripts. I have a script which creates database and source code backup and ftp it to other server. And login/password for destination ftp are ...