Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 serverfault.com Jan 23 '12 at 23:13

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

1 Answer 1

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

Your Answer

 
discard

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