Skip to main content
1 of 4
Tarlog
  • 333
  • 1
  • 2
  • 8

Changing user while scp

I need to copy file between Linux machines. The problem that the user I use to login (myuser), is different from the user that can access the file.

If I just ssh to the machine, I can switch the user using sudo su someuser, can I do it somehow while scp?

While using WinSCP I managed to do it, by configuring the SCP/Shell, so I believe there must be a similar way to do it via pure shell.

Thanks in advance!

Tarlog
  • 333
  • 1
  • 2
  • 8