Tag Info

New answers tagged


If your goal is to transfer all files from local_dir the * wildcard does the trick $ scp ~/local_dir/* user@host.com /var/www/html/target_dir The -r option means recursively so you must write it when you're trying to transfer an entire dir or dirs. From man scp -r Recursively copy entire directories. Note that scp follows symbolic links encountered in ...


scp has the -r argument. So, try using: $ scp -r ~/local_dir user@host.com:/var/www/html/target_dir The -r argument works just like the -r arg in cp, it will transfer your entire folder and all the files and subdirectories inside.


scp root@ Downloads/


@Dave Depending on the script you could run all through ssh: for server in s1 s2 s3; do ssh $server "command one; command two; ..." done Or split it into multiple calls: for server in s1 s2 s3; do ssh $server command one ssh $server command two ... done Feel free to add this to your answer, just passing by ..


As others have mentioned there are tools designed for managing multiple machines, but for a purely bash solution you can write a for loop and execute commands through ssh on a handful of nodes. Assuming host1 and host2 are the hostnames of ndoes you want this to happen from: for node in host1 host2; do scp /tmp/script.sh user@$node:/tmp/script.sh ...


Do yourself a favor and check out Ansible. It sounds like it's exactly what you need. It uses SSH and scales up easily, all you have to do is add the servers to the list as needed. Learning to make a playbook will take you an afternoon and will save you countless hours in the future.


There are several solutions for this - do you want to keep manual control of the steps and simply run through them simultaneously? The look at CSSH (if you're coming from a Linux system) or SuperPutty (if you're coming from a Windows system). If you simply want to automate everything, look at Expect.


Many machines don't have direct access to the Internet. They're behind a network appliance that performs network address translation (NAT): the machine has an IP address that's only valid on the internal network. When the machine makes a connection to an outside server, the NAT appliance relays the connection, so that the server sees a connection coming from ...


Not entirely sure if this answers your question properly, but when using scp to copy files over the internet, I believe you have to use a resolvable hostname or IP in place of the machine hostname. For example, if you wanted to copy a file (from the current active directory in the console on the remote machine you are logged into) to your home machine ...

Top 50 recent answers are included