ubuntu怎么切换到root用户,切换到root账号方法

2020-10-29 教育 166阅读
To get root access, you can use one of a variety of methods:
Run sudo and type in your login password, if prompted, to run only that instance of the command as root. Next time you run another or the same command without the sudoprefix, you will not have root access.
Run sudo -i. This will give you an interactive root shell at your current directory. Note that the$ at the end of your prompt has changed to a #, indicating that you have root access. From here you can run any sequence of commands as root, or run the command exit to leave the root shell.
Use the su (substitute user) command to get a root shell. This is effectively the same as usingsudo -i. Note that when you use this command it will ask for the root password and not your login password. These are not the same. You may have to set or change the root password by running sudo passwd root first.
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com