获得 ec2 的 root 访问权限
我正在尝试写入我在 EC2 上设置的 apache 服务器上的 /var/www/ 文件夹。所有权限均设置为“root”用户,但亚马逊只允许您以“ec2-user”身份登录其 AMI。
我正在使用 WinSCP。我使用 ssh 以 ec2-user 身份登录,并执行 sudo su,这样我就可以通过这种方式获得 root 访问权限。但是我如何通过 SFTP (WinSCP) 和 putty 获得相同的访问权限呢?
谢谢!
I am trying to write to my /var/www/ folder on my apache server that I setup on EC2. All of the permissions are set to the 'root' user, but amazon only lets you login to their AMI as 'ec2-user'.
I am using WinSCP. I logged in as ec2-user using ssh, and executed sudo su, so I can gain root access that way. But how do I go about having that same access through my SFTP (WinSCP) as well as through putty?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您通过 SSH 登录时,您可以在必要时
su
到 root 用户。就 FTP 和 SCP 而言,听起来您想让您的 www 文件夹归您要登录的用户所有,而不是 root。
这是您的服务器,您控制所有权限,并且可以创建任意数量的用户。
When you SSH in, you can
su
to the root user whenever necessary.As far as FTP and SCP, it sounds like you want to make your www folder owned by the user you're going to log in as, rather than root.
It's your server, you control all the permissions, and can create as many users as you want.
将 ec2-user 添加到拥有您的文档根的用户组(您的 apache 用户所属的组)
现在您可以安全地使用 WinSCP 或 SFTP。
Add ec2-user to the group of user which owns your Document root (group to which your apache user belongs to)
Now you can safely WinSCP or SFTP.