7

generally, i login to a server xyz.com using my login credentials(myuserid@xyz.com), my home = /home/user/myuserid/

after login, i do "su - someuser" to access the files.

i would like to copy a file from local machine to a directory in someuser eg: /abc/someuser/temp

for this, i am using scp somefile.txt myuserid@xyz.com:/abc/someuser/temp/

it is asking my password for myuserid and then says.. /abc/someuser/temp/ permission denied

what command shall i use to copy a file to su in remote host?

sandeep vn
  • 83
  • 1
  • 1
  • 3

1 Answers1

7

You'll have to use someuser's credentials to do the scp

scp somefile.txt someuser@xyz.com:/abc/someuser/temp/ 

Alternatively you can give myuserid permission to someuser's home directory.

amo
  • 3,432
  • 3
  • 24
  • 41
  • Thanks for the quick reply, scp somefile.txt someuser@xyz.com:/abc/someuser/temp/ it wont allow to directly connect to the host using someuser credentials. – sandeep vn Sep 29 '14 at 23:41
  • Then you'll have to give yourself permissions to someuser's home directory – amo Sep 29 '14 at 23:43