Main menu

Skip to primary content
Skip to secondary content
  • Wiki
  • Blog
  • About
  • Links
  • Chatter
  • Programming
  • Sys Admin
  • Music
  • Feeds

ProgClub

…because every programmer needs a good club!

Tag Archives: account

Ubuntu/Linux/Unix user and group account management

Posted on 2012-02-03 [Friday] by jj5
Reply

To disable a user login:

 $ sudo passwd -l username

To unlock a disabled user login:

 $ sudo passwd -u username

To specify all the secondary groups a user should be in (if they’re already in a group not in this list they will be removed from it) you use:

 $ sudo usermod -G grp_a,grp_b username

To append to the list of secondary groups:

 $ sudo usermod -a -G grp_c username

To show what users are in a group:

 $ grep ^group: /etc/group

E.g. to show which users are in the sudo group:

 $ grep ^sudo: /etc/group

You also need to check primary groups by grepping for the gid in the passwd file. For instance the gid for the sudo group is 27, so to see who’s in sudo you also have to:

 $ grep 27 /etc/passwd

Of course you should take all of the above with a grain of salt because there are a thousand caveats.

Posted in Sys Admin | Tagged account, group, linux, management, passwd, ubuntu, unix, user | Leave a reply

Archives

  • December 2018 (1)
  • September 2018 (1)
  • August 2018 (3)
  • July 2018 (5)
  • February 2018 (1)
  • December 2017 (1)
  • November 2017 (3)
  • August 2017 (3)
  • July 2017 (3)
  • June 2017 (1)
  • May 2017 (14)
  • April 2017 (2)
  • March 2017 (7)
  • February 2017 (3)
  • January 2017 (1)
  • December 2016 (5)
  • October 2016 (2)
  • September 2016 (1)
  • July 2016 (4)
  • June 2016 (5)
  • May 2016 (5)
  • April 2016 (11)
  • March 2016 (2)
  • January 2016 (1)
  • October 2015 (1)
  • September 2015 (8)
  • August 2015 (14)
  • July 2015 (3)
  • June 2015 (9)
  • May 2015 (6)
  • April 2015 (4)
  • March 2015 (6)
  • February 2015 (2)
  • January 2015 (8)
  • December 2014 (9)
  • November 2014 (17)
  • October 2014 (7)
  • September 2014 (5)
  • August 2014 (13)
  • July 2014 (21)
  • June 2014 (22)
  • May 2014 (55)
  • April 2014 (19)
  • February 2014 (1)
  • November 2013 (2)
  • October 2013 (7)
  • September 2013 (7)
  • August 2013 (12)
  • July 2013 (16)
  • November 2012 (24)
  • October 2012 (40)
  • September 2012 (7)
  • August 2012 (9)
  • July 2012 (14)
  • May 2012 (1)
  • April 2012 (9)
  • March 2012 (29)
  • February 2012 (60)
  • January 2012 (96)
  • December 2011 (29)
  • November 2011 (3)
  • October 2011 (8)
  • September 2011 (25)
  • August 2011 (40)

Categories

  • Business (2)
  • Chatter (79)
  • Design (78)
  • Diary (3)
  • Electronics (1)
  • Games (1)
  • Internet (161)
  • Mathematics (2)
  • Music (4)
  • Notes (1)
  • Philosophy (20)
  • Programming (444)
  • Science (1)
  • Sys Admin (365)
  • TODO (51)
  • Tribute (3)
  • Vocabulary (5)
  • Wishlist (1)

Recent Posts

  • A folder named ~/.cache/kioexec/krun/13821_0/ already exists
  • Salt file.recurse source file not found (file encoding issue)
  • Installing .NET on Debian 9
  • Making vertical-align work for table cells
  • How to reinstall macOS
February 2019
M T W T F S S
« Dec    
 123
45678910
11121314151617
18192021222324
25262728  

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Tags

apache bash c++ certificate code command line css data debian desktop disable error file firefox google HTML html5 http https install javascript jquery jsphp.co kde key linux list mailman mediawiki mysql netbeans password pcphpjs php postfix progclub server ssh ssl svn ubuntu vim web windows wordpress
Powered by WordPress