To list all users you can use:

cut -d: -f1 /etc/passwd

To add a new user you can use:

sudo adduser new_username

To remove/delete a user, first you can use:

sudo userdel username

Then you may want to delete the home directory for the deleted user account :

sudo rm -r /home/username

(Please use with caution the above command!)

To modify the username of a user:

usermod -l new_username old_username

To change the password for a user:

sudo passwd username

To change the shell for a user:

sudo chsh username

To change the details for a user (for example real name):

sudo chfn username

$ whoami
user1
$ su - user2
Password:
$ whoami
user2
$ exit
logout To add a user with root permission
sudo adduser <username>
sudo adduser <username> sudo

sudo groupadd vivek
sudo useradd -g vivek -G www-data,ftp vivek
sudo passwd vivek
 
echo 'yang ALL=(ALL) ALL' >> /etc/sudoers

 
 

Ubuntu user switch的更多相关文章

  1. iOS-C基础

    iOS开发系列--C语言之基础知识 概览 当前移动开发的趋势已经势不可挡,这个系列希望浅谈一下个人对IOS开发的一些见解,这个IOS系列计划从几个角度去说IOS开发: C语言 OC基础 IOS开发(i ...

  2. Ubuntu安装Gnome3

    参考:How To Install GNOME In Ubuntu 14.04 . Ubuntu11.10安装GNOME3,卸载UNITY和UNITY2D操作 和How to install Gnom ...

  3. ubuntu入门

    Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音.了解发音是有意义的,您不是第一个为此困惑的人,当然,也不会是最后一个:) 大多数的美国人读 ubun ...

  4. Switch&NAT 测试

    测试环境: PC1:Windows10 iperf3 PC2:Ubuntu iperf3 都装有千兆网卡,直连的iperf速度是935Mbps. 因为TXRX两个方向的数据是差不多的,下面的测试数据只 ...

  5. How To Set Up an OpenVPN Server on Ubuntu 14.04

    Prerequisites The only prerequisite is having a Ubuntu 14.04 Droplet established and running. You wi ...

  6. How to create vlan on Linux (with Cisco Catalyst Switch)

    In this article I want to share to you on how to create and configure vlan on Linux through Cisco Ca ...

  7. ubuntu一些基本软件安装方法

    ubuntu一些基本软件安装方法 首先说明一下 ubuntu 的软件安装大概有几种方式:1. deb 包的安装方式deb 是 debian 系 Linux 的包管理方式, ubuntu 是属于 deb ...

  8. ubuntu包管理

    查看某个文件属于哪个包dpkg -S add-apt-repository 包名software-properties-common命令名/usr/bin/add-apt-repository/usr ...

  9. ubuntu 14.04 compiz的ALT + TAB切换程序

    安装完ubuntu,发现不能使用ALT + TAB切换应用程序,翻遍所有百度结果,没有可行,都是拷这个拷那个...真实无语...FQgoogle,看的第一个就完美解决.记录下来,方便国人少走弯路. 首 ...

随机推荐

  1. Unity AngryBots愤怒的机器人demo研究

    做为Unity早期的经典demo,一直从3.5以后沿用到4.7.x版本.但其内部一些做法十分不合理.比如使用过多的根目录, 创建怪物和玩家不用SpawnPoint.AI.CheckPoint的代码实现 ...

  2. 嵌入资源的方式让Winform使用系统没有的字体,无需安装字体

    原文: How to embed a True Type font http://bobpowell.net/embedfonts.aspx 测试项目下载: http://files.cnblogs. ...

  3. [问题2014A05] 复旦高等代数 I(14级)每周一题(第七教学周)

    [问题2014A05]  (1) 设 \(x_1,x_2\cdots,x_n,x\) 都是未定元, \(s_k=x_1^k+x_2^k+\cdots+x_n^k\,(k\geq 1)\), \(s_0 ...

  4. 20个Linux服务器安全强化建议(二)

    接上文,继续介绍一些Linux服务器的安全配置. #6.强密码策略.   当我们使用 useradd.usermod 命令创建或维护用户账号时,确保始终应用强密码策略.例如,一个好的密码至少包括8个字 ...

  5. 替换 data.frame 中的特殊的值

    替换空值: foo <- data.frame("day"= c(1, 3, 5, 7), "od" = c(0.1, "#N/A", ...

  6. Hibernate配置文件

    <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hi ...

  7. struts的hello world小试

    struts的hello world小试 前面jdk的安装和配置,tomcat的安装和配置以及java ide的安装和配置就不写了. 在项目中使用流程 创建一个Web项目 导如struts 2.0.1 ...

  8. 访问google.com

    ping www.google.com 得到的IP来访问

  9. java易错基础知识点

    一. Switch 1.其能接受的数据类型有四个,char , byte, short, int2.Default 可放在switch中的任何一个地方,但只有给定的条件匹配不到时,才会执行3.Case ...

  10. 【转】Linux下patch打补丁命令

    [转]Linux下patch打补丁命令 转自:http://www.cnblogs.com/noaming1900/archive/2010/10/28/1863282.html 此命令用于为特定软件 ...