ubuntu添加用户到组

Ubuntu is a popular distributions used by a lot of companies as Desktop  and Server. As a system administrator one of the most recurring job is changing existing user group. In this tutorial we will look how to accomplish this task and some helper commands about this.

Ubuntu是许多公司用作桌面和服务器的流行发行版。 作为系统管理员,最经常发生的工作之一就是更改现有用户组。 在本教程中,我们将探讨如何完成此任务以及与此有关的一些帮助程序命令。

初级组 (Primary Group)

Primary group specifies the user first group which will be used in file creation and other operations. For example if a user creates a file the group of the file will be set to the user primary group.

主组指定将在文件创建和其他操作中使用的用户第一组。 例如,如果用户创建文件,则该文件的组将被设置为用户主要组。

中学组 (Secondary Group)

Secondary group is generally used for permission related operations. For example if we want to a user to access network sniffing device or features we need to add required group to the user.

次要组通常用于权限相关的操作。 例如,如果我们要用户访问网络嗅探设备或功能,则需要向用户添加所需的组。

打印给定的用户组 (Print Given User Groups)

Before doing any add or remove operation we generally prefer listing given user primary and secondary groups.  Group information is stored in file /etc/group and we will filter it with user name ismail like below.

在进行任何添加或删除操作之前,我们通常更喜欢列出给定的用户主要和次要用户组。 组信息存储在文件/etc/group ,我们将使用以下用户名ismail对其进行过滤。

$ grep ismail /etc/group

List Given User Groups
列出给定的用户组

使用id命令列出用户主要组信息(List User Primary Group Information with id Command)

There is id command which can be used to print user related information. This will list userid, group id (guid) and secondary groups of the user.

id命令可用于打印用户相关信息。 这将列出用户ID,组ID(GUID)和用户的辅助组。

$ id

List User Primary Group Information with id Command
使用id命令列出用户主要组信息

更改用户主要组(Change User Primary Group)

We can change user primary group with usermod command and -g option. As there is only single primary group for each user. We will change user ismail primary group to the root with the following command.

我们可以使用usermod命令和-g选项更改用户主组。 因为每个用户只有一个主要组。 我们将使用以下命令将用户ismail主组更改为root

$ sudo usermod -g root ismail

将用户添加到辅助组 (Add User To The Secondary Group)

We can change this group with usermod command by using  -a option.  In this example we will add primary group of user ismail into root group.

我们可以使用-a选项,使用usermod命令更改该组。 在此示例中,我们将用户ismail主要组添加到root组中。

$ sudo usermod -a -G root ismail

Change User Primary Group
更改用户主要组
.u7f46987bb9079c20603bef453fe0229f , .u7f46987bb9079c20603bef453fe0229f .postImageUrl , .u7f46987bb9079c20603bef453fe0229f .centered-text-area { min-height: 80px; position: relative; } .u7f46987bb9079c20603bef453fe0229f , .u7f46987bb9079c20603bef453fe0229f:hover , .u7f46987bb9079c20603bef453fe0229f:visited , .u7f46987bb9079c20603bef453fe0229f:active { border:0!important; } .u7f46987bb9079c20603bef453fe0229f .clearfix:after { content: ""; display: table; clear: both; } .u7f46987bb9079c20603bef453fe0229f { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u7f46987bb9079c20603bef453fe0229f:active , .u7f46987bb9079c20603bef453fe0229f:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u7f46987bb9079c20603bef453fe0229f .centered-text-area { width: 100%; position: relative; } .u7f46987bb9079c20603bef453fe0229f .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u7f46987bb9079c20603bef453fe0229f .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u7f46987bb9079c20603bef453fe0229f .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u7f46987bb9079c20603bef453fe0229f:hover .ctaButton { background-color: #E67E22!important; } .u7f46987bb9079c20603bef453fe0229f .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u7f46987bb9079c20603bef453fe0229f .u7f46987bb9079c20603bef453fe0229f-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u7f46987bb9079c20603bef453fe0229f:after { content: ""; display: block; clear: both; }

LEARN MORE  How To Download and Install Kali Security and Penetration Test Linux Distribution?

.u7f46987bb9079c20603bef453fe0229f , .u7f46987bb9079c20603bef453fe0229f .postImageUrl , .u7f46987bb9079c20603bef453fe0229f .centered-text-area { min-height: 80px; position: relative; } .u7f46987bb9079c20603bef453fe0229f , .u7f46987bb9079c20603bef453fe0229f:hover , .u7f46987bb9079c20603bef453fe0229f:visited , .u7f46987bb9079c20603bef453fe0229f:active { border:0!important; } .u7f46987bb9079c20603bef453fe0229f .clearfix:after { content: ""; display: table; clear: both; } .u7f46987bb9079c20603bef453fe0229f { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u7f46987bb9079c20603bef453fe0229f:active , .u7f46987bb9079c20603bef453fe0229f:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u7f46987bb9079c20603bef453fe0229f .centered-text-area { width: 100%; position: relative; } .u7f46987bb9079c20603bef453fe0229f .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u7f46987bb9079c20603bef453fe0229f .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u7f46987bb9079c20603bef453fe0229f .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u7f46987bb9079c20603bef453fe0229f:hover .ctaButton { background-color: #E67E22!important; } .u7f46987bb9079c20603bef453fe0229f .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u7f46987bb9079c20603bef453fe0229f .u7f46987bb9079c20603bef453fe0229f-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u7f46987bb9079c20603bef453fe0229f:after { content: ""; display: block; clear: both; }

了解更多信息如何下载和安装Kali Security and Penetration Test Linux发行版?

翻译自: https://www.poftut.com/add-existing-user-group-ubuntu/

ubuntu添加用户到组

ubuntu添加用户到组_如何在Ubuntu中将现有用户添加到组中?相关推荐

  1. ubuntu 禁用透明大页_如何在ubuntu上默认启用透明的大页面?

    如何在ubuntu上默认启用透明的大页面? $uname -a Linux yoda 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13 ...

  2. python数据框添加新列_如何在Python中将新列添加到现有数据框?

    数据框是一种二维数据结构,其中数据以表格格式存储,以行和列的形式. 它可以可视化为SQL数据表或excel工作表表示形式.可以使用以下构造函数创建它-pd.Dataframe(data, index, ...

  3. ubuntu添加路由_如何在Ubuntu,Linux中添加新路由?

    ubuntu添加路由 I have a box with Ubuntu Linux and I want to add a new route to my box. Because I want to ...

  4. ubuntu添加面板_如何在Ubuntu的顶部面板中添加天气信息

    ubuntu添加面板 Modern operating systems offer weather information out-of-the-box. There's Windows 10's w ...

  5. go 写文件_如何在 Ubuntu 20.04 上安装 Go

    本文最先发布在: 如何在 Ubuntu 20.04 上安装 Go​www.itcoder.tech Go,通常被称为 golang,它是一门由 Google 创建的现代化的开源编程语言,它允许你构建实 ...

  6. ubuntu ftp服务器_如何在Ubuntu上安装FTP服务器?

    ubuntu ftp服务器 In this tutorial, let's learn how to install FTP server on Ubuntu. FTP or File Transfe ...

  7. groupdel 删除组_如何在Linux中删除组– groupdel命令

    groupdel 删除组 Linux groupdel command is used to delete a group. This is a very powerful command, so u ...

  8. webmin安装_如何在Ubuntu 18.04上安装Webmin

    webmin安装 Are you averse to running commands on a terminal and instead prefer managing your Linux sys ...

  9. lighttpd安装_如何在Ubuntu服务器上安装Lighttpd

    lighttpd安装 In this tutorial, we will walk you through how to install Lighttpd on Ubuntu Server. Ligh ...

最新文章

  1. mathcal 对应于什么库_如何快速构建React组件库
  2. 刷题-CC150-Java实现
  3. 【学习随手记】POSIX消息队列执行报Permission denied的问题。
  4. mysql5.6安装sys库_MySQL5.6数据库优化my.cnf配置
  5. 【JS 逆向百例】37网游登录接口参数逆向
  6. 【HDU - 2072 】单词数(字符串读入技巧,sstream大法,水题,字符串读入格式)
  7. adb连接MuMu、逍遥、夜神、雷电模拟器以及腾讯手游助手以及断开连接
  8. 如何修复MySQL配置文件?
  9. Lucene实践之Query
  10. python实现对某招聘网接口测试获取平台信息
  11. SSM中 web.xml配置文件
  12. 详解Windows Shim的攻防利用
  13. 【数据结构--二叉树】--附超详细图解
  14. 今日头条信息流 - 工具菜单详解
  15. 系统地学习3D建模!教你零基础入门
  16. C语言动态规划和文件操作练习——通讯录
  17. 在Android上应用PhoneGap和Dojo Mobile
  18. Java SSLSocket客户端认证配置
  19. jre包括jvm和java核心类库_JDK、JRE、JVM分别是什么及它们之间的有什么关联
  20. 一文读懂 快速掌握示波器使用及原理

热门文章

  1. 做医院三年软件实施工程师之葵花宝典
  2. Leetcode(77)——组合
  3. 如何写后端开发之接口设计文档
  4. 巧用微信业余创业-吴雪峰-专题视频课程
  5. Mock和Spy的区别 打桩的区别
  6. Matlab中ind2sub和sub2ind函数
  7. 【快速改文件名后缀】和【谷歌浏览器网页图片一键下载插件】推荐
  8. 基于PCA主成分分析的线性拟合
  9. 1130: 杨辉三角 C语言
  10. 2020集训第二场总结