简体   繁体   中英

Cannot create folder within Compute Engine - CentOS 6 var/www/html/

I am new to Cloud Computing, and executing commands from the terminal so please bear with me.

I have learnt the below list in 3 days so I may not have much knowledge.

Using the terminal. Using SSH. Cloud Computing. Using CentOS from putty.

Problem: I am stuck on permissions.

I am running Centos 6 and I was able to Putty into the server and install Apache, PHP & MySql. This would mean that I have some amount of permissions.

I CAN create files using the sudo nano command in the terminal. I can edit the files too using Nano editor. This should mean that Nano has the permissions to create files and not me. I cant delete those files that are created. I cant create files using touch.

I am NOT able to create folders from the terminal. I get a permissions denied error. This is just in /var/www/html/ folder. In the user folder, I am able to create files and folders as well as use wget.

I cannot sudo to root as it has been disabled and is not an option.

The documentation on the Compute Engine website says that I have the same privileges as root.

When I connect using WinSCP and the same credentials I am NOT able to create files or folders.

From my Admin Interface, I can see the permissions list and but there is no option to edit it.

I cannot find any documentation.

Some useful knowledge.

I own this account with Compute Engine so there is no account other than mine.

I have tried deleting the SSH keys and adding them again. Nothing changed.

I have tried using the browser based ssh option provided from the admin. No luck.

I have tried using another Instance. No luck.

I was trying to copy 'Adminer' to the html folder. I got an error permissions denied. I created a file called adminer.php from the terminal which I was able to and tried copy pasting the code to the file in nano editor. I got logged out from the system. I tried this 3 times to be sure.

I aim to copy and run my codeigniter application in Computer Engine.

Can anyone please help me overcome this.

Thanks, Warren

Users are automatically created and setup as sudoers, therefore you do have the permissions. Also, SSHing as root directly is not enabled, however sudo-ing and switching to root should work just fine. The following should also allow you to change to root:

[boyan@centOS-test]$ sudo -i
[root@centOS-test ~]#

I ran on CentOS (6.5 Final), installed httpd and could create/remove directories without errors while using sudo.

[boyan@centOS-test]$ sudo mkdir /var/www/somerandomdir
[boyan@centOS-test]$ cd /var/www/ && ls -a
.  ..  cgi-bin  error  html  icons  somerandomdir
[boyan@centOS-test www]$ sudo rmdir /var/www/somerandomdir/
[boyan@centOS-test www]$ ls -a
.  ..  cgi-bin  error  html  icons
[boyan@centOS-test www]$

I strongly recommend you go through the QuickStart for GCE if you have not done so already. You should be able to execute all of the commands in that guide without errors. My suggestion is to simply try again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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