Without a home directory

sudo useradd myuser

With home directory

sudo useradd -m myuser

Then set the password

sudo passwd myuser

Then set the shell

sudo usermod -s /bin/bash myuser
answered Sep 1 '08 at 18:59
quackingduck

3,08952122
 
    
Simple but very useful answer. Thanks. – Brady Zhu Sep 17 '13 at 5:59
    
unfortunately, I indeed follow this to add a user, and then get the error 'Access denied' when I try to sign in with it. What's wrong with it? – Brady Zhu Sep 17 '13 at 6:03

------------------------

http://stackoverflow.com/questions/38288/how-do-i-add-a-user-in-ubuntu

ubuntu 添加和删除用户的更多相关文章

  1. Ansible 从MySQL数据库添加或删除用户

    mysql_user - 从MySQL数据库添加或删除用户. 概要 要求(在执行模块的主机上) 选项 例子 笔记 状态 支持 概要 从MySQL数据库添加或删除用户. 要求(在执行模块的主机上) My ...

  2. ubuntu 14.04 添加、删除用户,修改用户名称,修改主机名

    ubuntu添加用户 sudo adduser test ubuntu删除用户 sudo userdel test cd /home/ sudo rm -r test

  3. centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

    修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...

  4. linux (RHEL) 添加和删除用户

    linux添加新用户使用 useradd -----create a new user or update default new user information 删除用户使用userdel  -- ...

  5. mysql、添加和删除用户、添加权限

    创建用户      mysql>insert into mysql.user(Host,User,Password) values("localhost","tes ...

  6. Linux命令之useradd和userdel(添加、删除用户)

    一.[useradd]:添加用户命令 1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起始目录,使用权限是超级用户. 2.格式 useradd [-d home] [-s sh ...

  7. Shell脚本——添加和删除用户

    写一个脚本admin_user.sh,其用法格式为: admin_user.sh --add USERLIST --del USERLIST -v|--verbose -h|--help 其中, -h ...

  8. centos 添加/删除用户和用户组

    centos系统添加/删除用户和用户组     在centos中增加用户使用adduser命令而创建用户组使用groupadd命令,这个是不是非常的方便呀,其实复杂点的就是用户的组与组权限的命令了,下 ...

  9. Ubuntu建立和删除用户

    添加用户: sudo adduser xxx 这样的命令会在home目录下添加一个帐号 sudo useradd xxx 仅仅是添加用户, 不会在home目录添加帐号 删除用户: 在普通用户下:sud ...

随机推荐

  1. Linux内核 ——进程管理之进程诞生(基于版本4.x)

    <奔跑吧linux内核>3.1笔记,不足之处还望大家批评指正 进程是Linux内核最基本的抽象之一,它是处于执行期的程序.它不仅局限于一段可执行代码(代码段),还包括进程需要的其他资源.在 ...

  2. LeetCode101--对称二叉树

    ''' 给定一个二叉树,检查它是否是镜像对称的. ''' class TreeNode: def __init__(self, x): self.val = x self.left = None se ...

  3. tomcat 修改默认端口8080 为 80端口

    首先,找到你的安装目录,如图: 打开server.xml文件,找到8080,如图: 将 8080  改成你想要的端口,如 80 即可.改完后,记得要重启tomcat! 将端口改成 80 后,访问就不需 ...

  4. 快速排序php

    <?php /** * Created by PhpStorm. * User: brady.wang * Date: 2017/11/10 * Time: 9:45 */ $arr=array ...

  5. 【Luogu】P1306斐波那契公约数(递推)

    题目链接 有个定理叫gcd(f(n),f(m))=f(gcd(n,m)) 所以递推就好了. #include<cstdio> #include<cstdlib> #includ ...

  6. 【Luogu】P2015二叉苹果树(DP,DFS)

    题目链接 设f[i][j][k]表示给以i为根节点的子树分配j条可保留的树枝名额的时候,状态为k时能保留的最多苹果. k有三种情况. k=1:我只考虑子树的左叉,不考虑子树的右叉,此时子树能保留的最多 ...

  7. 刷题总结——愤怒的小鸟(NOIPDAY2T3)

    题目: 题目背景 NOIP2016 提高组 Day2 T3 题目描述 Kiana 最近沉迷于一款神奇的游戏无法自拔.简单来说,这款游戏是在一个平面上进行的. 有一架弹弓位于 (0,0) 处,每次 Ki ...

  8. 类 this指针 const成员函数 std::string isbn() const {return bookNo;}

    转载:http://www.cnblogs.com/little-sjq/p/9fed5450f45316cf35f4b1c17f2f6361.html C++ Primer 第07章 类 7.1.2 ...

  9. Spring-IOC源码解读2.1-BeanDefinition的Resource定位

    Spring通过ResourceLoader来处理得到的Resource.在前面我们知道容器初始化是以refresh()方法为入口的,内部的实现首先准备上下文,然后通过obtainFreshBeanF ...

  10. 【SPOJ220】Relevant Phrases of Annihilation(后缀数组,二分)

    题意: n<=10,len<=1e4 思路: #include<cstdio> #include<cstring> #include<string> # ...