问题描述
我遇到了一个烦人的问题.这很令人沮丧.我正在学校使用计算机来学习 Coursera Startup 课程.我正在尝试连接到 Amazon EC2 实例.我下载了密钥对.我检查权限.
I'm facing an annoying problem. It's been pretty frustrating. I am using a computer at my school to work on the Coursera Startup class. I am trying to connect to an Amazon EC2 instance. I downloaded the key pair. I check permissions.
mac5-library:startup roh21$ ls -l
total 6
-rw-rw-rw-@ 1 roh21 108 1692 Jun 22 16:45 startup-class-key.pem
所以,它不安全.所以我需要更改权限.我试试:
So, it's not secure. So I need to change the permissions. I try:
mac5-library:startup roh21$ chmod 400 startup-class-key.pem
mac5-library:startup roh21$ ls -l
total 6
-r--r--r--@ 1 roh21 108 1692 Jun 22 16:45 startup-class-key.pem
仍然对所有人具有读取权限.只是为了演示会发生什么,我这样做:
Still has read permissions to everyone. Just to demonstrate what happens I do this:
mac5-library:startup roh21$ chmod 600 startup-class-key.pem
mac5-library:startup roh21$ ls -l
total 6
-rw-rw-rw-@ 1 roh21 108 1692 Jun 22 16:45 startup-class-key.pem
没有root权限就不能修改用户权限吗?如果能提供任何帮助,我将不胜感激.
Is it impossible to change permissions to the user without root permission? I'd be grateful for any kind of help.
推荐答案
我将文件复制到了我的 ~/.ssh
文件夹,然后使用 chmod
更改了权限.做到了.
I copied the file to my ~/.ssh
folder and then changed the permissions with chmod
. That did it.
只是为了提供更多信息,ssh文件夹的权限,
Just to provide more information, the permissions for the ssh folder,
drwx------ 8 roh21 108 272 Jun 26 17:26 .ssh
以及我最初使用的文件夹的权限
And the permissions to the folder I used initially
drwxrwxrwx 2 roh21 108 2048 Jun 23 06:32 startup
我很好奇为什么即使在多次尝试使用 chmod -R
选项后,我也无法更改对 startup
文件夹的权限.
I curious as to why I could not change the permissions to the startup
folder even after multiple attempts with the chmod -R
option.
另外,请注意我在学校图书馆使用的是 Mac OS X.
Also, note that I was using Mac OS X in my school's library.
这篇关于chmod 无法更改权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!