I want to copy a file from server-a to server-d but I can access server-d only from server-b and then to server-c. server-a can only access server-b, server-b can only access server-c, server-c can only access server-d..
Currently I do it like this:
server-a> scp /tmp/file.txt user@server-b server-a> ssh user@server-b server-b> scp /tmp/file.txt user@server-c server-b> ssh user@server-c server-c> scp /tmp/file.txt user@server-d
This could be through 5,6,7,.. servers
Can I do this is one command?