Ubuntu user switch
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的更多相关文章
- iOS-C基础
iOS开发系列--C语言之基础知识 概览 当前移动开发的趋势已经势不可挡,这个系列希望浅谈一下个人对IOS开发的一些见解,这个IOS系列计划从几个角度去说IOS开发: C语言 OC基础 IOS开发(i ...
- Ubuntu安装Gnome3
参考:How To Install GNOME In Ubuntu 14.04 . Ubuntu11.10安装GNOME3,卸载UNITY和UNITY2D操作 和How to install Gnom ...
- ubuntu入门
Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音.了解发音是有意义的,您不是第一个为此困惑的人,当然,也不会是最后一个:) 大多数的美国人读 ubun ...
- Switch&NAT 测试
测试环境: PC1:Windows10 iperf3 PC2:Ubuntu iperf3 都装有千兆网卡,直连的iperf速度是935Mbps. 因为TXRX两个方向的数据是差不多的,下面的测试数据只 ...
- 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 ...
- 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 ...
- ubuntu一些基本软件安装方法
ubuntu一些基本软件安装方法 首先说明一下 ubuntu 的软件安装大概有几种方式:1. deb 包的安装方式deb 是 debian 系 Linux 的包管理方式, ubuntu 是属于 deb ...
- ubuntu包管理
查看某个文件属于哪个包dpkg -S add-apt-repository 包名software-properties-common命令名/usr/bin/add-apt-repository/usr ...
- ubuntu 14.04 compiz的ALT + TAB切换程序
安装完ubuntu,发现不能使用ALT + TAB切换应用程序,翻遍所有百度结果,没有可行,都是拷这个拷那个...真实无语...FQgoogle,看的第一个就完美解决.记录下来,方便国人少走弯路. 首 ...
随机推荐
- maven参考文章推荐
maven依赖.聚合.继承.版本管理:https://my.oschina.net/u/204498/blog/545724 maven profile : http://elim.iteye.com ...
- spring多线程与定时任务
本篇主要描述一下spring的多线程的使用与定时任务的使用. 1.spring多线程任务的使用 spring通过任务执行器TaskExecutor来实现多线程与并发编程.通常使用ThreadPoolT ...
- windows平台(不包括ARM的CE)通用的压缩和解压缩
通用是相对的,这里指的是xp和win7(其他版本我没测试过,不要用不要来找我) #define CMP_FRM COMPRESSION_FORMAT_LZNT1|COMPRESSION_ENGINE_ ...
- dom4j-1.6.1.jar与dom4j-1.4.jar
今天在上线的项目中遇到一个很奇怪的问题 File file = new File("O:/20160817/91a2cb1c-62eb-4a31-a1f6-3af8ab71782a/adi6 ...
- Linux phpwind论坛的安装
1:新建文件夹phpwind
- ubuntu下安装、启动和卸载SSH
想往VMWare虚拟机上的Ubuntu里面拷贝代码,发现之前安装好的secureCRT链接不上.发现是ssh安装配置出了问题,于是就把openssh-server卸载后重装,发现又是与openssh- ...
- src url href uri的区别和联系
- python 反射调用
因为目前在写一个python的项目,用到了Python的反射机制,所以做一下笔记,把写项目过程中的感悟记下来. 先简单介绍下Demo用到的函数: sys.path 是python的模块的路径集,是一个 ...
- caffe中python接口的使用
下面是基于我自己的接口,我是用来分类一维数据的,可能不具通用性: (前提,你已经编译了caffe的python的接口) 添加 caffe塻块的搜索路径,当我们import caffe时,可以找到. 对 ...
- Android 利用SurfaceView进行图形绘制
SurfaceView使用介绍 SurfaceView是View的一个特殊子类,它的目的是另外提供一个线程进行绘制操作. 要使用SurfaceView进行绘制,步骤如下: 1.用SurfaceView ...