• ubuntu默认root密码是什么?


    安装ubuntu后你用su 命令会发现密码始终不对,是因为root还没有密码,你需要设置root密码才能使用它。

    第一个 user 是在 admin 组 ,所以他可以给 root 设置密码 , so ... 

    sudo passwd root 
    [sudo] password for you :---> 输入你的密码,不回显 
    Enter new UNIX password: --- > 设置root 密码 
    Retype new UNIX password: --> 重复

    然后,你试着 su,再输入刚才的密码,你会发现ok了,成了root。root@ubuntums:~#

    切换跟用户su - 或 su root 

    官方答案:

    The root account is disabled when you first install Ubuntu. The first user created during the installation has administrative rights on the system, and can run programs as root with sudo, using only their normal user password. For example: sudo apt-get update. 
    If you wish to use the root account in more traditional UNIX fashion, you can set the root password by typing sudo passwd root. This will allow you to use su or login as root on the console. 
    If you need a shell with root privileges, run sudo -s. 
    All uses of sudo will require the user's password.

     切换用户

    用法:su  用户名

    如:su  user1

    其中,user1是系统中存在的用户

    注意:切换前必须确保user1有合法密码,并且当前用户知道该密码!

    若user1当前没有密码,则可以用以下命令添加密码:sudo passwd user1

    之后输入相应密码即可为user1设置密码。

  • 相关阅读:
    ZROI NOI2019集训汇总
    牛客 在二叉树中找到累加和为指定值的最长路径长度
    牛客 遍历二叉树的神级方法
    牛客 打印二叉树边界节点
    牛客 实现二叉树先序,中序和后序遍历
    LeetCode K个一组翻转链表
    LeetCode 相交链表&环形链表II
    LeetCode 分隔链表
    LeetCode 复制带随机指针的链表
    LeetCode 回文链表
  • 原文地址:https://www.cnblogs.com/youxin/p/3006201.html
Copyright © 2020-2023  润新知