scp file from machine A to machine with no password prompt and copy same file to different location

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am trying to write a shell script through which i want to copy file from machineA to machine B.I have already setup passwordless connection .In the machine B again the samefile i want to copy to different path in the which
the directory is owned by different user. How can I achive this
Example:
Machine A
scp /home/user/txt user@xhost/home/user/txtMachine B
It simply copies the file without asking password under home directory
machineB:/home/user/I again want to copy the same file into diffrent location i get permission denied:
cp /home/user/txt /apps/java/software/ # (permission denied)
linux scp
add a comment |Â
up vote
0
down vote
favorite
I am trying to write a shell script through which i want to copy file from machineA to machine B.I have already setup passwordless connection .In the machine B again the samefile i want to copy to different path in the which
the directory is owned by different user. How can I achive this
Example:
Machine A
scp /home/user/txt user@xhost/home/user/txtMachine B
It simply copies the file without asking password under home directory
machineB:/home/user/I again want to copy the same file into diffrent location i get permission denied:
cp /home/user/txt /apps/java/software/ # (permission denied)
linux scp
1
You've got two requirements: (a)scpthe file to a target, (b) execute a command as a different user on that target. Both parts are answered (separately) here on Unix & Linux.
â roaima
Sep 21 at 23:17
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to write a shell script through which i want to copy file from machineA to machine B.I have already setup passwordless connection .In the machine B again the samefile i want to copy to different path in the which
the directory is owned by different user. How can I achive this
Example:
Machine A
scp /home/user/txt user@xhost/home/user/txtMachine B
It simply copies the file without asking password under home directory
machineB:/home/user/I again want to copy the same file into diffrent location i get permission denied:
cp /home/user/txt /apps/java/software/ # (permission denied)
linux scp
I am trying to write a shell script through which i want to copy file from machineA to machine B.I have already setup passwordless connection .In the machine B again the samefile i want to copy to different path in the which
the directory is owned by different user. How can I achive this
Example:
Machine A
scp /home/user/txt user@xhost/home/user/txtMachine B
It simply copies the file without asking password under home directory
machineB:/home/user/I again want to copy the same file into diffrent location i get permission denied:
cp /home/user/txt /apps/java/software/ # (permission denied)
linux scp
linux scp
edited Sep 21 at 23:16
roaima
40.8k547110
40.8k547110
asked Sep 21 at 23:02
Ramya aws
1
1
1
You've got two requirements: (a)scpthe file to a target, (b) execute a command as a different user on that target. Both parts are answered (separately) here on Unix & Linux.
â roaima
Sep 21 at 23:17
add a comment |Â
1
You've got two requirements: (a)scpthe file to a target, (b) execute a command as a different user on that target. Both parts are answered (separately) here on Unix & Linux.
â roaima
Sep 21 at 23:17
1
1
You've got two requirements: (a)
scp the file to a target, (b) execute a command as a different user on that target. Both parts are answered (separately) here on Unix & Linux.â roaima
Sep 21 at 23:17
You've got two requirements: (a)
scp the file to a target, (b) execute a command as a different user on that target. Both parts are answered (separately) here on Unix & Linux.â roaima
Sep 21 at 23:17
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
When you copy "the same file" to a different location, you need to scp with a user account which has access to the file AND the location you're copying it to. Without such permissions you'll get permission denied.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
When you copy "the same file" to a different location, you need to scp with a user account which has access to the file AND the location you're copying it to. Without such permissions you'll get permission denied.
add a comment |Â
up vote
0
down vote
When you copy "the same file" to a different location, you need to scp with a user account which has access to the file AND the location you're copying it to. Without such permissions you'll get permission denied.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
When you copy "the same file" to a different location, you need to scp with a user account which has access to the file AND the location you're copying it to. Without such permissions you'll get permission denied.
When you copy "the same file" to a different location, you need to scp with a user account which has access to the file AND the location you're copying it to. Without such permissions you'll get permission denied.
answered Sep 22 at 1:16
Emmanuel Rosa
2,5851411
2,5851411
add a comment |Â
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%2f470644%2fscp-file-from-machine-a-to-machine-with-no-password-prompt-and-copy-same-file-to%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
1
You've got two requirements: (a)
scpthe file to a target, (b) execute a command as a different user on that target. Both parts are answered (separately) here on Unix & Linux.â roaima
Sep 21 at 23:17