google 云平台SSH 执行此命令需要root权限

google cloud platform SSH You need to be root to perform this command

当我尝试通过 putty SSH yum install python-setuptools && easy_install pip 安装某些东西时,它告诉我:

You need to be root to perform this command

即使我使用 sudo yum install python-setuptools && easy_install pip 仍然会被拒绝许可。

如何获得 root 用户权限或如何解决这个问题?

您在命令的第二部分缺少 sudo。这样做:

sudo yum install python-setuptools && sudo easy_install pip

原因是 && 是条件 shell 表达式的一部分,仅当第一个命令成功时才执行 && 之后的命令。 sudo 本身就是一个 command/program,所以,没有第二个 sudo,这只是说 "if sudo yum install python-setuptools was successful, run easy_install pip (without sudo)"。