Linux Amazon Ec2 FTP 写入权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10337951/
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-06 06:00:51  来源:igfitidea点击:

Amazon Ec2 FTP Write Permission

javalinuxtomcatamazon-ec2amazon-web-services

提问by vikas27

I am able to successfully connect to amazon ec2 instance using filezilla. The Username i used is ec2-user. So when i try to transfer my application war to tomcat it says

我能够使用 filezilla 成功连接到亚马逊 ec2 实例。我使用的用户名是 ec2-user。因此,当我尝试将我的应用程序战争转移到 tomcat 时,它说

/var/lib/tomcat6/webapps/RealEstateERP.war: open for write: permission denied
 Error: File transfer failed.

I tried to change permission use filezilla but not allowed to do so. I know there is no write permission, but how do i change it.

我试图更改权限使用 filezilla 但不允许这样做。我知道没有写权限,但我该如何更改它。

I ma new to linux. Please help me.

我是 linux 新手。请帮我。

采纳答案by shashankaholic

The ec2-userdon't have permission to write files in /var/lib/tomcat6/webapps/. Only rootuser can do so. You have two ways here to do so:

EC2用户没有在/ var / lib中/ tomcat6中/ webapps /目录写权限的文件。只有root用户可以这样做。您有两种方法可以这样做:

1) Copy files to /home/ec2-user/ using filezilla. Now SSH into linux machine through putty. Change to root user using command sudo -s. Then copy file from /home/ec2-user to /var/lib/tomcat6/webapps/ using command cp -i RealEstateERP.war /var/lib/tomcat6/webapps/.

1) 使用 filezilla 将文件复制到 /home/ec2-user/。现在通过putty SSH 进入linux 机器。使用命令更改为 root 用户sudo -s。然后使用 command 将文件从 /home/ec2-user 复制到 /var/lib/tomcat6/webapps/ cp -i RealEstateERP.war /var/lib/tomcat6/webapps/

2) SSH into linux machine through putty.Change to root user using command sudo -s.Provide write permission to all users on /var/lib/tomcat6/webapps/ using command chmod 777 /var/lib/tomcat6/webapps/. Then copy files to directory directly from filezilla.

2) 通过putty SSH 进入linux 机器。使用命令更改为root 用户。使用命令sudo -s为/var/lib/tomcat6/webapps/ 上的所有用户提供写权限chmod 777 /var/lib/tomcat6/webapps/。然后直接从filezilla复制文件到目录。