Linux 使用 FTP 保持文件权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6961966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 05:30:29  来源:igfitidea点击:

Keeping file permissions with FTP

linuxpermissionsftp

提问by Matthew24

Is there a way I can upload my files from my computer to my server without losing the permissions? Everything is linux.

有没有一种方法可以将我的文件从我的计算机上传到我的服务器而不会丢失权限?一切都是Linux。

Thank you!

谢谢!

采纳答案by vvohra87

Basically all FTP clients (cute, filezilla, smart, yafc, etc) have the option to set file permissions.

基本上所有 FTP 客户端(cute、filezilla、smart、yafc 等)都可以选择设置文件权限。

I have not yet seen any feature / option to permanently persist the file permissions from your computer to the server. However you can in filezilla and in cuteftp ( i use these 2) set an advanced property which will auto apply a permission set of your choice to all files uploaded.

我还没有看到任何将文件权限从您的计算机永久保存到服务器的功能/选项。但是,您可以在 filezilla 和 cutftp(我使用这两个)中设置一个高级属性,该属性将自动将您选择的权限集应用于上传的所有文件。

Also, i think this is not likely to ever be released as a feature since file permissions are also based on user! Different users on your computers and different users on your server all of which may or may not have differing permissions.

另外,我认为这不太可能作为功能发布,因为文件权限也是基于用户的!您计算机上的不同用户和服务器上的不同用户都可能具有也可能没有不同的权限。

Hope this helped. Cheers.

希望这有帮助。干杯。

PS: let me know if you can't find the option in filezilla or cuteftp

PS:如果您在 filezilla 或 cutftp 中找不到该选项,请告诉我

回答by Brian Gordon

It depends on your FTP client. I'm sure nearly all FTP clients have this option. For example, my favorite command-line FTP client, Yafc, lets you:

这取决于您的 FTP 客户端。我确信几乎所有的 FTP 客户端都有这个选项。例如,我最喜欢的命令行 FTP 客户端Yafc可以让您:

put -p filename

to putwhile preserving file permissions.

put同时p保留文件权限。

回答by Uwe Geuder

You are aware that ftp is not the program to use on the internet in 2011. The password will be send in cleartext. (In a wired or WPA Enterprise protected wireless network you might be OK as long as all your traffic stays inhouse)

您知道 ftp 不是 2011 年在 Internet 上使用的程序。密码将以明文形式发送。(在有线或 WPA Enterprise 保护的无线网络中,只要您的所有流量都在内部,您可能没问题)

sftp is the secure replacement (based on ssh). putand getcommands have the -Poption to preserve?the permissions.

sftp 是安全的替代品(基于 ssh)。putget命令可以-P选择保留权限。