简体   繁体   English

如何删除目标用户使用scp创建的目标文件夹

[英]How to delete target folder created using scp by target user

I have a machines A B C . 我有一台机器A B C only Machine B have access to A & C . 只有Machine B可以访问AC For machine A I have root access , machine B I have root access and for machine C I have User level access. 对于machine A我具有root访问权限,对于machine B我具有root访问权限,对于machine C我具有用户级别访问权限。

1.2.3.4 is the ip address assigned to machine B . 1.2.3.4是分配给machine B的IP地址。

When I am doing from machine A as 当我从machine A
scp -pr ./logs/ root@1.2.3.4:/common/tftpboot/
It creating folder name logs inside <machine C>:/common/tftpboot/ I have given all read write execute permission to all user groups and others as machine A is comes under others using chmod 777 tftpboot 它创建的文件夹名称logs<machine C>:/common/tftpboot/我已经给所有read write execute所有许可的user groupsothers作为machine A是来自下他人使用chmod 777 tftpboot

Now after copying logs folder I am not able to delete the <machine C>:/common/tftpboot/logs/ folder from User of machine C though machine C user has given the 777 permission to /common/tftpboot/ folder as the logs folder is created by others ie machine A root 现在,复制后logs文件夹,我不能删除<machine C>:/common/tftpboot/logs/来自文件夹Usermachine C虽然machine C user给予777权限/common/tftpboot/文件夹中的logs文件夹由其他人创建,即machine A root

So I want to do scp to copy the folder only (and not individual files) and still I want that user c should able to delete the folder created by machine A scp after analysing logs 所以我想做scp只复制文件夹(而不是单个文件),但我仍然希望user c在分析日志后应该能够删除machine A scp创建的文件夹

Now I need to do ssh to Machine B from Machine A and then only I can able to delete the scp created logs folder. 现在,我需要从Machine AMachine B ssh,然后只有我才能删除scp创建的日志文件夹。

can anybody help to do so ?? 有人可以帮忙吗?

在执行SCP之前,我已将日志文件夹的权限更改为777,即chmod -R 777 ./logs,现在我可以删除在Machine C由scp创建的文件夹了

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

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