Win10已经支持Ubuntu的Bash了。

在cmd中输入bash就可以进入bash界面。但此时是普通用户登录的。

如果希望更改默认的登录用户,可以在cmd中更改。

具体的命令是:

lxrun /setdefaultuser root
Found UNIX user: root
Default UNIX user set to: root

lxrun是管理bash on win10的工具。可以install、uninstall或update。

lxrun的help信息:

lxrun -h
Performs administrative operations on the LX subsystem Usage:
/install - Installs the subsystem
Optional arguments:
/y - Do not prompt user to accept
/uninstall - Uninstalls the subsystem
Optional arguments:
/full - Perform a full uninstall
/y - Do not prompt user to accept
/setdefaultuser - Configures the subsystem user that bash will be launched as. If the user does not exist it will be created.
Optional arguments:
username - Supply the username
/y - If username is supplied, do not prompt to create a password
/update - Updates the subsystem's package index

比如安装Bash:

lxrun /install
-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
https://aka.ms/uowterms
Type "y" to continue: y
Downloading from the Windows Store... %
Extracting filesystem, this will take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: hengwei
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!

比如删除Bash:

lxrun /uninstall
This will uninstall Ubuntu on Windows.
This will remove the Ubuntu environment as well as any modifications and new applications with the exception of: C:\Users\hengwei\AppData\Local\lxss\home
C:\Users\hengwei\AppData\Local\lxss\root Type "y" to continue: y
Uninstalling...

比如更新Bash:

lxrun /update
Checking for updates...
Ign http://archive.ubuntu.com trusty InRelease
Get: http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Get: http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get: http://security.ubuntu.com trusty-security/main amd64 Packages [606 kB]
Hit http://archive.ubuntu.com trusty-backports InRelease
......

Win10 Bash更改默认用户的更多相关文章

  1. centos7安装Jenkins更改默认端口并配置Ldap服务器进行用户认证

    应用环境:Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作.   Jenkins官网:https://jenkins.io/ 测试环境:一台Centos ...

  2. 更改 Nginx 服务的默认用户

    为什么要更改 Nginx 服务的默认用户:就像更改 ssh 的默认 22 端口一样,增加安全性,Nginx 服务的默认用户是 nobody ,我们更改为 nginx 1.添加 nginx 用户 use ...

  3. Nginx优化之基本安全优化 (隐藏Nginx软件版本号信息,更改源码隐藏Nginx软件名及版本号,更改Nginx服务的默认用户)

    一,隐藏Nginx软件版本号信息 查看版本号 curl -I 192.168.0.220 HTTP/1.1 200 OK Server: nginx/1.6.2 #这里清晰的暴露了Web版本号(1.6 ...

  4. Mac 如何将apache的这个默认目录更改到用户目录下

    如何将apache的这个默认目录更改到用户目录下. 做如下更改即可: 1.在自己的用户目录下新建一个Sites文件夹,我的用户目录为gaocuili 2.进到cd /etc/apache2/users ...

  5. win10 无法修改默认程序 默认打开方式的解决方法

    此时是2018年11月24日 win10 pro 64位 版本是1803  具体版本号是17134 情景: 我的状况是.json文件的默认打开方式被新安装的应用霸占了,然后无论是通过“右键-属性-更改 ...

  6. 『现学现忘』Git基础 — 7、设置Git Bash终端默认路径

    目录 1.Git Bash默认路径 2.如何查看Git Bash终端默认路径 3.如何修改Git Bash终端的默认路径 4.拓展:指定目录进入Git Bash终端 5.注意事项 如果您不熟悉Git命 ...

  7. Client默认用户及登录密码(转)

    Client默认用户及登录密码 SAP系统(如ERP.CRM等)安装完成,初始化状态下有若干个客户端(Client).如果是生产系统,一般只有000.001.066等三个Client:如果是IDES系 ...

  8. sql导入默认用户解决杰奇cms无法登陆管理员账户问题

    前些天下载杰奇cms来体验一下,从a5下载的杰奇1.8版,不是默认的安装程序,上传文件,手工导入sql数据库,修改了config配置文件,很快就完工了.前台可以展现,除了有些乱码显示之外,想要修改相关 ...

  9. Discuz更改默认搜索模块

    由于网站使用DZ的侧重点不同,在搜索中可能需要更改默认搜索模块 首先找到模板中搜索模块对应的文件,默认模板中搜索模块的地址是 template\default\common\pubsearchform ...

随机推荐

  1. Windos Server 2008 Backup 安装使用

    系统环境:Windos 2008 R2 x64 实施方案:备份系统 完全备份,每周备份一次,备份文件映射到文件服务器. 安装备份工具 使用Windos Sserver Backup 做备份 设置每周备 ...

  2. Bürkert 流体控制系统 (8611 型通用调节器)

    Type Description High-Tech Made EasyThe new universal controller eCONTROL Type 8611 brings an essent ...

  3. box-flex兼容写法

    box-flex布局在这几年发生了多次变化,可分为2009版.2011版以及2013版, 区分: display:box(inline-box), box-{*}的格式为2009版 display:b ...

  4. MySQL数据库基本操作(四)

    在进行查询之前,我们要先建好关系表,并往数据表中插入些数据.为查询操作做好准备. 五张关系表的创建: #创建并进入数据库: mysql> CREATE DATABASE `info`; Quer ...

  5. INSPIRED启示录 读书笔记 - 第8章 巴顿将军的忠告

    目标管理 永远不要告诉别人怎么做.告诉他们做什么,他们自然会发挥天赋,给你惊喜.    ——乔治·史密斯·巴顿 首先,产品经理收集需求时,常听到客户建议“如何做”产品,而不是产品应该“做什么”.如果产 ...

  6. 【转载】poj 1276 Cash Machine 【凑钱数的问题】【枚举思路 或者 多重背包解决】

    转载地址:http://m.blog.csdn.net/blog/u010489766/9229011 题目链接:http://poj.org/problem?id=1276 题意:机器里面共有n种面 ...

  7. Linux 配置 SSL 证书

    完整的 SSL 证书分为四个部分: CA 根证书 (root CA) 中级证书 (Intermediate Certificate) 域名证书 证书密钥 (仅由您持有) 以 COMODO Positi ...

  8. Codeforces Round #368 (Div. 2) A , B , C

    A. Brain's Photos time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  9. tyvj 1057 金明的预算方案 背包dp

    P1057 金明的预算方案 时间: 1000ms / 空间: 131072KiB / Java类名: Main 背景 NOIP2006 提高组 第二道 描述 金明今天很开心,家里购置的新房就要领钥匙了 ...

  10. 写hibernate.cfg.xml时报错The content of element type "property" must match "(meta*,(column|formula)*,type?)".

    原配置文件是这样的 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-ma ...