I have 2 servers. I can connect to server B only using server A. In my ~/.ssh/config file:Host serverB  Hostname serverb  User root  ForwardAgent yes  Port 22  ProxyCommand ssh user@serverA nc %h %pWhen I login to serverA and type ssh root@serverB It connects without asking for password, but when I type ssh ServerB on my local machine, it asks for ServerB's password. Why?
ssh password-less login doesn't work using proxycommand
ssh
ProxyCommand gives just a tunnel to pipe the outer ssh connection through.When you do ssh serverB from serverA, you're probably using a key on your account on serverA.When you do ssh serverB from your client machine, the fact that you're connecting via that nc command started on serverA is not going to magically give you access to the keys on serverA.You'll need to add serverA's keys to your client agent.For instance:ssh-add <(ssh serverA 'cat .ssh/id_rsa')To add the key in .ssh/id_rsa on serverA (ksh93/bash/zsh syntax above).