简体   繁体   English

无法在Compute Engine中创建文件夹-CentOS 6 var / www / html /

[英]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. 我在3天内了解了以下列表,因此我可能并不了解。

Using the terminal. 使用终端。 Using SSH. 使用SSH。 Cloud Computing. 云计算。 Using CentOS from putty. 从油灰中使用CentOS。

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. 我正在运行Centos 6,并且能够将Putty插入服务器并安装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. 我可以在终端中使用sudo nano命令创建文件。 I can edit the files too using Nano editor. 我也可以使用Nano编辑器编辑文件。 This should mean that Nano has the permissions to create files and not me. 这应该意味着Nano拥有创建文件的权限,而非我。 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. 这只是在/ var / www / html /文件夹中。 In the user folder, I am able to create files and folders as well as use wget. 在用户文件夹中,我能够创建文件和文件夹以及使用wget。

I cannot sudo to root as it has been disabled and is not an option. 我无法以root身份使用sudo,因为它已被禁用,不是一种选择。

The documentation on the Compute Engine website says that I have the same privileges as root. Compute Engine网站上的文档说,我具有与root相同的特权。

When I connect using WinSCP and the same credentials I am NOT able to create files or folders. 当我使用WinSCP和相同的凭据进行连接时,我无法创建文件或文件夹。

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. 我拥有Compute Engine的这个帐户,因此除了我的帐户外没有其他帐户。

I have tried deleting the SSH keys and adding them again. 我尝试删除SSH密钥,然后再次添加它们。 Nothing changed. 没有改变。

I have tried using the browser based ssh option provided from the admin. 我尝试使用管理员提供的基于浏览器的ssh选项。 No luck. 没运气。

I have tried using another Instance. 我尝试使用另一个实例。 No luck. 没运气。

I was trying to copy 'Adminer' to the html folder. 我试图将“管理员”复制到html文件夹。 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. 我从终端创建了一个名为adminer.php的文件,并尝试将代码粘贴到nano编辑器中。 I got logged out from the system. 我已从系统注销。 I tried this 3 times to be sure. 我尝试了3次以确保。

I aim to copy and run my codeigniter application in Computer Engine. 我的目标是在Computer Engine中复制并运行我的codeigniter应用程序。

Can anyone please help me overcome this. 谁能帮我解决这个问题。

Thanks, Warren 谢谢沃伦

Users are automatically created and setup as sudoers, therefore you do have the permissions. 将自动创建用户并将其设置为sudoers,因此您确实具有权限。 Also, SSHing as root directly is not enabled, however sudo-ing and switching to root should work just fine. 另外,未启用直接以root用户身份进行SSH的操作,但是sudo-ing和切换到root用户应该可以正常工作。 The following should also allow you to change to root: 以下内容还应允许您更改为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. 我在CentOS(6.5最终版)上运行,安装了httpd,并且可以在使用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. 我强烈建议您通过GCE 快速入门 (如果尚未这样做)。 You should be able to execute all of the commands in that guide without errors. 您应该能够正确执行该指南中的所有命令。 My suggestion is to simply try again. 我的建议是再试一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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