![](/img/trans.png)
[英]Getting PERMISSION DENIED while copying a file from local to remote using SCP
[英]change file permission while transferring from local to server
我在本地擁有700個權限的文件。 我需要使用scp命令將此文件移動到服務器中的abc目錄。 在這里,文件許可應為755,但我所獲得的文件僅具有700許可。 如何將所有文件移動到此目錄的權限默認設置為755。
您可以使用rsync進行傳輸:
rsync --chmod=u+rwx,g+rwx,o+rx file.txt user@host:abc/
如果您更喜歡使用scp,則可以在傳輸后設置權限:
scp file.txt user@host:abc/
ssh user@host 'chmod 755 abc/file.txt'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.