Using scp with a forwarded ssh agent

Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I'm currently trying to scp a file from one server to another, using an ssh key on my local computer.
this is the command I'm currently using:
sudo scp -r -o "ForwardAgent yes" <new_folder> <second-server-path>
and I've followed this github doc to verify that my ssh agent is being forwarded to the second server's terminal.
-o "ForwardAgent yes" comes from this reference, but does not appear on my man scp reference.
However, after all this, the command still asks for a password (which we are trying to avoid). Any ideas on how to use the ssh forwarding?
linux ssh terminal
add a comment |Â
up vote
3
down vote
favorite
I'm currently trying to scp a file from one server to another, using an ssh key on my local computer.
this is the command I'm currently using:
sudo scp -r -o "ForwardAgent yes" <new_folder> <second-server-path>
and I've followed this github doc to verify that my ssh agent is being forwarded to the second server's terminal.
-o "ForwardAgent yes" comes from this reference, but does not appear on my man scp reference.
However, after all this, the command still asks for a password (which we are trying to avoid). Any ideas on how to use the ssh forwarding?
linux ssh terminal
can you access via ssh to the second server without password ?
â Wissam Roujoulah
Nov 30 '16 at 14:12
I can access the terminal of both servers from my own computer without a password. However, I am running into these issues between copying a file from one server to another @WissamAl-Roujoulah
â efong5
Nov 30 '16 at 14:39
check the user that you are trying to use on the remote server and make sure that is the same use that you added a ssh key for it when you copy the file
â Wissam Roujoulah
Nov 30 '16 at 14:41
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm currently trying to scp a file from one server to another, using an ssh key on my local computer.
this is the command I'm currently using:
sudo scp -r -o "ForwardAgent yes" <new_folder> <second-server-path>
and I've followed this github doc to verify that my ssh agent is being forwarded to the second server's terminal.
-o "ForwardAgent yes" comes from this reference, but does not appear on my man scp reference.
However, after all this, the command still asks for a password (which we are trying to avoid). Any ideas on how to use the ssh forwarding?
linux ssh terminal
I'm currently trying to scp a file from one server to another, using an ssh key on my local computer.
this is the command I'm currently using:
sudo scp -r -o "ForwardAgent yes" <new_folder> <second-server-path>
and I've followed this github doc to verify that my ssh agent is being forwarded to the second server's terminal.
-o "ForwardAgent yes" comes from this reference, but does not appear on my man scp reference.
However, after all this, the command still asks for a password (which we are trying to avoid). Any ideas on how to use the ssh forwarding?
linux ssh terminal
linux ssh terminal
edited Nov 30 '16 at 16:24
Jakuje
15.8k52850
15.8k52850
asked Nov 30 '16 at 14:09
efong5
1814
1814
can you access via ssh to the second server without password ?
â Wissam Roujoulah
Nov 30 '16 at 14:12
I can access the terminal of both servers from my own computer without a password. However, I am running into these issues between copying a file from one server to another @WissamAl-Roujoulah
â efong5
Nov 30 '16 at 14:39
check the user that you are trying to use on the remote server and make sure that is the same use that you added a ssh key for it when you copy the file
â Wissam Roujoulah
Nov 30 '16 at 14:41
add a comment |Â
can you access via ssh to the second server without password ?
â Wissam Roujoulah
Nov 30 '16 at 14:12
I can access the terminal of both servers from my own computer without a password. However, I am running into these issues between copying a file from one server to another @WissamAl-Roujoulah
â efong5
Nov 30 '16 at 14:39
check the user that you are trying to use on the remote server and make sure that is the same use that you added a ssh key for it when you copy the file
â Wissam Roujoulah
Nov 30 '16 at 14:41
can you access via ssh to the second server without password ?
â Wissam Roujoulah
Nov 30 '16 at 14:12
can you access via ssh to the second server without password ?
â Wissam Roujoulah
Nov 30 '16 at 14:12
I can access the terminal of both servers from my own computer without a password. However, I am running into these issues between copying a file from one server to another @WissamAl-Roujoulah
â efong5
Nov 30 '16 at 14:39
I can access the terminal of both servers from my own computer without a password. However, I am running into these issues between copying a file from one server to another @WissamAl-Roujoulah
â efong5
Nov 30 '16 at 14:39
check the user that you are trying to use on the remote server and make sure that is the same use that you added a ssh key for it when you copy the file
â Wissam Roujoulah
Nov 30 '16 at 14:41
check the user that you are trying to use on the remote server and make sure that is the same use that you added a ssh key for it when you copy the file
â Wissam Roujoulah
Nov 30 '16 at 14:41
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
scpdoes not support to forward your agent (hardcoded to be disabled in the code) so this is not possible what you are trying.The problem is in
sudo. Connection tossh-agentis stored in environment variableSSH_AUTH_SOCK(echo $SSH_AUTH_SOCK) and this variable is not preserved during thesudoso there are two possibilities:Do not use
sudotoscp. Run justscpto some sane location and thensudo cpthe file to the desired location.Force
sudoto preserve env. variables using the-Eswitch:sudo scp -r <new_folder> <second-server-path>
When you want to copy the file between two servers, use
-3switch, which will make both authentications from your host, where you have access to your agent.
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
scpdoes not support to forward your agent (hardcoded to be disabled in the code) so this is not possible what you are trying.The problem is in
sudo. Connection tossh-agentis stored in environment variableSSH_AUTH_SOCK(echo $SSH_AUTH_SOCK) and this variable is not preserved during thesudoso there are two possibilities:Do not use
sudotoscp. Run justscpto some sane location and thensudo cpthe file to the desired location.Force
sudoto preserve env. variables using the-Eswitch:sudo scp -r <new_folder> <second-server-path>
When you want to copy the file between two servers, use
-3switch, which will make both authentications from your host, where you have access to your agent.
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
add a comment |Â
up vote
3
down vote
accepted
scpdoes not support to forward your agent (hardcoded to be disabled in the code) so this is not possible what you are trying.The problem is in
sudo. Connection tossh-agentis stored in environment variableSSH_AUTH_SOCK(echo $SSH_AUTH_SOCK) and this variable is not preserved during thesudoso there are two possibilities:Do not use
sudotoscp. Run justscpto some sane location and thensudo cpthe file to the desired location.Force
sudoto preserve env. variables using the-Eswitch:sudo scp -r <new_folder> <second-server-path>
When you want to copy the file between two servers, use
-3switch, which will make both authentications from your host, where you have access to your agent.
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
scpdoes not support to forward your agent (hardcoded to be disabled in the code) so this is not possible what you are trying.The problem is in
sudo. Connection tossh-agentis stored in environment variableSSH_AUTH_SOCK(echo $SSH_AUTH_SOCK) and this variable is not preserved during thesudoso there are two possibilities:Do not use
sudotoscp. Run justscpto some sane location and thensudo cpthe file to the desired location.Force
sudoto preserve env. variables using the-Eswitch:sudo scp -r <new_folder> <second-server-path>
When you want to copy the file between two servers, use
-3switch, which will make both authentications from your host, where you have access to your agent.
scpdoes not support to forward your agent (hardcoded to be disabled in the code) so this is not possible what you are trying.The problem is in
sudo. Connection tossh-agentis stored in environment variableSSH_AUTH_SOCK(echo $SSH_AUTH_SOCK) and this variable is not preserved during thesudoso there are two possibilities:Do not use
sudotoscp. Run justscpto some sane location and thensudo cpthe file to the desired location.Force
sudoto preserve env. variables using the-Eswitch:sudo scp -r <new_folder> <second-server-path>
When you want to copy the file between two servers, use
-3switch, which will make both authentications from your host, where you have access to your agent.
edited Nov 30 '16 at 15:03
answered Nov 30 '16 at 14:57
Jakuje
15.8k52850
15.8k52850
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
add a comment |Â
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
"When you want to copy the file between two servers, use -3 switch, which will make both authentications from your host, where you have access to your agent." according to the man page, there is no -3 option. Only 1,2,4 or 6.
â Sacha Vorbeck
Sep 5 at 7:56
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
@SachaVorbeck It probably means that you have very old OpenSSH version. Try to update.
â Jakuje
Sep 5 at 18:10
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f327085%2fusing-scp-with-a-forwarded-ssh-agent%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
can you access via ssh to the second server without password ?
â Wissam Roujoulah
Nov 30 '16 at 14:12
I can access the terminal of both servers from my own computer without a password. However, I am running into these issues between copying a file from one server to another @WissamAl-Roujoulah
â efong5
Nov 30 '16 at 14:39
check the user that you are trying to use on the remote server and make sure that is the same use that you added a ssh key for it when you copy the file
â Wissam Roujoulah
Nov 30 '16 at 14:41