简体   繁体   English

scp文件到本地远程服务器中的不同用户

[英]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/ 通常,我使用我的登录凭据(myuserid@xyz.com)登录到服务器xyz.com,我的主页= / home / user / myuserid /

after login, i do "su - someuser" to access the files. 登录后,我做“su - someuser”来访问文件。

i would like to copy a file from local machine to a directory in someuser eg: /abc/someuser/temp 我想将文件从本地机器复制到某个用户的目录,例如:/ abc / someuser / temp

for this, i am using scp somefile.txt myuserid@xyz.com:/abc/someuser/temp/ 为此,我使用scp somefile.txt myuserid@xyz.com:/ abc / someuser / temp /

it is asking my password for myuserid and then says.. /abc/someuser/temp/ permission denied 它询问我的密码是否为myuserid,然后说.. / abc / someuser / temp / permission denied

what command shall i use to copy a file to su in remote host? 我将使用什么命令将文件复制到远程主机中的su?

You'll have to use someuser's credentials to do the scp 您必须使用某些用户的凭据来执行scp

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

Alternatively you can give myuserid permission to someuser 's home directory. 或者你可以给myuserid权限someuser主目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 scp 将远程文件从 Linux 复制到本地服务器 - Copying a remote file from Linux to a local server using scp 从本地到 Heroku 服务器的 SCP 文件 - SCP File from local to Heroku Server SCP与paramiko,使用不同的远程和本地目录 - SCP with paramiko, using different remote and local directories SCP从远程服务器到另一台远程服务器 - SCP from remote server to another remote server 我该如何计划一个脚本,使用CRON和SCP每小时使用时间戳将文件从远程服务器复制到本地计算机? - How can I schedule a script to copy a file from a remote server to my local machine every hour with a time stamp using CRON & SCP? 使用scp从远程服务器下载文件。 但是返回错误 - Downloading file using scp from a remote server. But returning error SCP:如何使用过滤器从远程服务器复制文件 - scp: how to copy a file from remote server with a filter 使用SCP将文件从本地复制到远程时被拒绝 - Getting PERMISSION DENIED while copying a file from local to remote using SCP Shell命令将文件从一台服务器复制到具有不同用户的远程服务器 - Shell command to copy file from one server to remote server with different user 如何使用 scp 从远程服务器复制目录,不包括特定的子目录 - How to copy directory from remote server with scp, excluding a specific subdirectory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM