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. Asp.net 之Application

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  2. (转) CCTextFieldTTF输入框

    CCTextFieldTTF输入框 分类: cocos2d-x 2013-04-08 16:32 2964人阅读 评论(1) 收藏 举报 新建工程,testInput 修改HelloWorldScen ...

  3. ArcGIS Javascript查询数据库并添加到地图上

    将数据存放到数据库中,动态的调取比较灵活,数据变动后不需要改变图层的属性表. 此处采用的方法是通过jquery查询数据库,并将数据库的结果生产json串返回给js,在js中动态解析json串增加点至地 ...

  4. Scrum Meeting 5-20151207

    任务安排 姓名 今日任务 明日任务 困难 董元财 将服务器转移到学校服务器 修复app特定情况下崩溃 无 胡亚坤 学习连接服务器框架 发布界面和购买界面 无 刘猛 在github上分配好任务 写博客 ...

  5. [Oracle] SQL*Loader 详细使用教程(2)- 命令行参数

    sqlldr工具   SQL*Loader的客户端工具是sqlldr,在操作系统的命令行下输入sqlldr,后面不接任何参数,将显示帮助信息如下所示(所有命令行参数的简单描述及其默认值),所以你并不需 ...

  6. PHP 小方法之 显示 今天 昨天 上周 上月 近三月 的时间

    if(!function_exists('get_date_array')){ function get_date_array(){ $_NOW = time(); $today_begin = st ...

  7. 20160824_CentOS6.4x64_关闭IPv6

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

  8. AlwaysOn与数据库镜像端点问题

    今天在搭建一个测试环境的时候发现一个问题,我将AlwaysOn环境中某节点上的某个非可用性组里的数据库想实时备份到另外一台服务器上,因此我找了一个没有加域的工作组的服务器,与AlwaysOn主节点去搭 ...

  9. remount failed: Operation not permitted ,怎么办呢?

    remount failed: Operation not permitted ,怎么办呢? 1. 确定是否正确连接手机了$ adb devices 2. 进入shell$ adb shell 3. ...

  10. JS重要知识点

    这里列出了一些JS重要知识点(不全面,但自己感觉很重要).彻底理解并掌握这些知识点,对于每个想要深入学习JS的朋友应该都是必须的. 讲解还是以示例代码搭配注释的形式,这里做个小目录: JS代码预解析原 ...