SSH config for multiple hops in Linux

Often some hosts in corporate network are available only from several gateway machines. The scheme looks like that: you connect to gateway ssh -A and then to desired host from gateway machines ssh -A But the problem arises when you want to copy or download something from You have to do it in two hops, because is not available from your machine directly. The solution is ssh forwarding. Just add the following (edit according your network settings) lines to ~/.ssh/config: