bash 如何使用 putty 运行 sudo 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30794816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to run sudo command using putty
提问by 112233
I'm just getting started with Linux environment. SO the terms sudo, bash and putty are all very new to me.
我刚刚开始使用 Linux 环境。所以术语 sudo、bash 和 putty 对我来说都很陌生。
I'm based on windows local machine.I'm using putty to upload,delete,and create file into a remote Linux server.I have to use putty to bridge the gap.I can actually login successfully using putty.
我基于windows本地机器。我使用putty上传、删除和创建文件到远程Linux服务器。我必须使用putty来弥合差距。我实际上可以使用putty成功登录。
The problem now, I just have no idea on how to run the sudo command to do anything to the server. Where do I start as I don't even see any window to type out anything in putty screen.
现在的问题,我只是不知道如何运行 sudo 命令来对服务器做任何事情。我从哪里开始,因为我什至没有看到任何窗口可以在腻子屏幕中输入任何内容。
When I run Putty.exe I only see session,terminal,window,connection.
当我运行 Putty.exe 时,我只看到会话、终端、窗口、连接。
Thank you.
谢谢你。
回答by zavtra
You should be aware that sudo is not entirely a command by itself. It requires an argument of a command, such as executing a script. What sudo does is grant you super-user privileges for the execution of the command. (You can think of it as "super-user do: command").
您应该意识到 sudo 本身并不完全是一个命令。它需要命令的参数,例如执行脚本。sudo 的作用是授予您执行命令的超级用户权限。(您可以将其视为“超级用户执行:命令”)。
While I'm not familiar with using Putty, if you have managed to successfully login to the server you are targeting, you should be able to navigate to the "terminal" window and execute commands from there.
虽然我不熟悉使用 Putty,但如果您成功登录到目标服务器,您应该能够导航到“终端”窗口并从那里执行命令。
I recommend following this guide: http://internal.math.arizona.edu/services/computing/remote-access/shell/putty
我建议遵循本指南:http: //internal.math.arizona.edu/services/computing/remote-access/shell/putty
Once you're connected to the remote computer, you can begin executing commands, although if you don't know what they do, you should really be careful in your choice of executing them.
一旦您连接到远程计算机,您就可以开始执行命令,尽管如果您不知道它们的作用,则在选择执行它们时应该非常小心。