A
A
Alexander N++2015-05-26 18:18:26
linux
Alexander N++, 2015-05-26 18:18:26

SCP log in as one user then change user and start copying?

In general, I don’t know how to file it
. This is how I used to copy without changing the user.

nohup scp -P 3022 -r . [email protected]:/var/www/MYSITE.com/httpdocs

Scored, the admin came and did everything through lftp
It doesn't get worse when the admin is paranoid.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Tartmin, 2015-05-26
@baskerville42

If you have access to SCP then you should also have access to SSH. What prevents to copy the data under one user, and then through chown to change the rights to files?

K
Konkase, 2015-05-27
@Konkase

serverA - the server on which the required file is located.
We execute on serverB:
And like this, if serverB is behind nat:

ssh serverA sudo cp /file /tmp/file && sudo chown webmaster /tmp/file
scp serverA:/tmp/file /file
ssh serverA sudo rm /tmp/file

A
Andrew, 2015-05-26
@caa888

If not thinking at all, then I see a script with expect:
log in, then go under the user we need and copy the files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question