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. Centos7下安装配置Redsocks

    Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...

  2. 简单练习题2编写Java应用程序。首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”、“取款”和“余额查询”。其次, 编写一个主类,在主类中测试Account类的功能

    编写Java应用程序.首先定义一个描述银行账户的Account类,包括成员变 量“账号”和“存款余额”,成员方法有“存款”.“取款”和“余额查询”.其次, 编写一个主类,在主类中测试Account类的 ...

  3. 远程读取json数据并写入数据库

    参考:http://www.jb51.net/article/39937.htm $curlPost = 'a=1&b=2';//模拟POST数据$ch = curl_init();curl_ ...

  4. [问题2014A11] 复旦高等代数 I(14级)每周一题(第十三教学周)

    [问题2014A11]  设 \(n\) 阶方阵 \(A,B\) 满足: \((A+B)^2=A+B\), \(\mathrm{r}(A+B)=\mathrm{r}(A)+\mathrm{r}(B)\ ...

  5. 第 十一 天 Flagmeng 和动画

    1.flagment 的使用,生命周期. 传递数据. 2. 基本动画的使用. 3. 对话框的使用. 4.样式和主题.

  6. gdb进行多线程调试

    http://blog.csdn.net/xabc3000/article/details/6819867 http://www.cnblogs.com/xuxm2007/archive/2011/0 ...

  7. 学习mongo系列(二) 新建数据库,collection ,insert(),save()

    一,新建数据库user:use user 二,查看当前使用的数据库:db 三,查看所有数据库:show dbs 四,删除当前正在使用的数据库:db.dropDatabase() 五,在当前数据库中插入 ...

  8. php总结 --- 2.字符串

    字符串 恩聪 正则表达式 恩聪 中文验证 if (preg_match("/[\x{4e00}-\x{9fa5}]{2,4}\s{0,}\w{8,15}/u", $keyword) ...

  9. 20160824_CentOS6.4x64_关闭IPv6

    1.参考网址: http://blog.csdn.net/suplxj/article/details/7773423 2.我的操作: #cat <<EOF>>/etc/mod ...

  10. alu features menu

    可以把所有的custom menu和menu link移植到新的环境下,并且增加新的menu link不会吧module变成overridden, 只需到时recreate生成一个新的module包, ...