Get permission to work with files on my Amazon EC2 Ubuntu server using FTP-WinSCP

有些话、适合烂在心里 提交于 2020-06-25 09:48:12

问题


I have an Ubuntu server on Amazon, I installed everything for working with it (php, mysql, phpmyadmin, apache..), The problem is that I cant move around or edit files using the FTP.

I get the error message:

Permission denied.
Error code: 3
Error message from server: Permission denied

from my WINSCP.

The only way I can trancefer/edit file is using 'putty' with the sudo/nano command.

I found a lot of information about this on google, but there are no updated soulution I can find. Linux isn't my usual work-space.

How do I get the permissions working for the WINSCP ?


回答1:


A lot of answers say to change permissions on /var/www/ ... however AWS shortcuts out of the WWW folder and into the /var/app/current/ directory. If all else fails try:

sudo chown -R -v ec2-user /var/app/current/



回答2:


On Ubuntu image in AWS, default user is ubuntu. Instead of using system folders like /var/... better to use /home/your_folder. Then change the ownership using {chown} command. For eg.

$ sudo chown -R -v ubuntu /home/your_folder/

This will change the ownership of 'your_folder' and contents inside it from 'root' user to 'ubuntu'. Then Winscp should be able to upload/delete/create files using SFTP/FTP etc..




回答3:


Change file permision by command chmod 777 /var/app/current/ and transfer files to the directory



来源:https://stackoverflow.com/questions/28261503/get-permission-to-work-with-files-on-my-amazon-ec2-ubuntu-server-using-ftp-winsc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!