Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm running the following command

scp \desktop\myfolder\deployments\myfile.txt user@host:/path/to/whereyouwant/thefile

In an attempt to transfer a file from my local windows 7 machine to a remote server (using putty). This works with the exception that I don't have write permissions to that folder.

So if I do the following... 1) log into server using putty 2) sudo su - myadminuser 3) run scp, how would I use the myadminuser? If I try something like...

scp \desktop\myfolder\deployments\myfile.txt **myadminuser**@host:/path/to/whereyouwant/thefile

The problem is I don't have the myadminuser login.

share|improve this question

migrated from Jan 23 '12 at 23:13

This question came from our site for system and network administrators.

Simple answer:
you can't do that directly.

Extended answer:
Use SCP to transfer the file to a directory where you have write access with that user, then use ssh to move the file with sudo
e.g.: ssh host sudo mv myfile.txt /path/to/the/destination

share|improve this answer
cool will give this a try thanks – HelloWorld Jan 23 '12 at 18:18
// , Did it work? – Nathan Basanese Sep 3 '15 at 18:30
In most cases I think you'd have to add the -t option for this to work. See – Matt Browne Oct 19 '15 at 18:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.