Windows 10 - Bash (Ubuntu) SU(根密码)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37609356/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 22:19:29  来源:igfitidea点击:

Windows 10 - Bash (Ubuntu) SU (Root Password)

bashwindows-10windows-subsystem-for-linux

提问by Dave Hamilton

Recently updated to Windows 10, installed Ubuntu Bash. Wanted to start configuring, But I have hit a wall already.

最近更新到 Windows 10,安装了 Ubuntu Bash。想开始配置,但我已经碰壁了。

When installed, you are asked for a username and password for your account. This creates a user level.

安装后,系统会要求您输入帐户的用户名和密码。这将创建一个用户级别。

Is it possible to access to root user, SU?

是否可以访问 root 用户 SU?

Every time I try, it asks for a password, and none of the accounts on the PC work (i.e., Windows 10 admin account password does not work). Tried default passwords too etc., all fail.

每次我尝试时,它都会要求输入密码,但 PC 上的所有帐户都不起作用(即 Windows 10 管理员帐户密码不起作用)。也试过默认密码等,都失败了。

The reason for it is when looking at the users home directory: When creating a file, it creates it under my Windows User Account (Permissions).

原因是在查看用户主目录时:创建文件时,它会在我的 Windows 用户帐户(权限)下创建它。

But when I view files created from Bash, they are created for Root user.

但是当我查看从 Bash 创建的文件时,它们是为 Root 用户创建的。

So this is the confusion, I modified bashrcand it's no longer owned by root, So it's not accessible.

所以这是混乱,我修改了bashrc它不再归root所有,所以它不可访问。

But I cannot login to root to create or modify the files.

但是我无法登录到 root 来创建或修改文件。

Am I being a complete noob or something? enter image description here

我是一个完整的菜鸟还是什么? 在此处输入图片说明

When bashrcis not owned by Root, when loading Bash.exe, I get .bashrc Input/output error.

bashrc不归 Root 所有,加载时Bash.exe,我得到.bashrc Input/output error.

回答by Matteo

as far as i know you'll have to type "sudo su"

据我所知你必须输入“sudo su”