简体   繁体   中英

scp file to different user in the remote server from local

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM