Saltycrane logo

SaltyCrane Blog

Notes on Python, Django, and web development on Ubuntu Linux

    

Notes on users and groups on Linux

Here are some notes on some basic tasks dealing with users, groups, and permissions on Ubuntu Linux. All these commands (except passwd) are done as root. If you are not root, prepend sudo to all the commands.

  • Add a user, sofeng
    # adduser sofeng
  • Change your password:
    $ passwd
  • Create a developer group
    # addgroup developer
  • Add user sofeng to the developer group
    # adduser sofeng developer
  • Give developer group sudo power:
    Add the following line to /etc/sudoers:
    %developer ALL=(ALL) ALL
  • Change owner to sofeng, and group to developer, of directory, mydir, and all its subdirectories:
    # chown -R sofeng:developer mydir
  • Change permisions of directory, mydir, and all its subdirectories, to be writable by the group, developer:
    # chmod -R g+w mydir

Post a comment

Required
Required, but not displayed
Optional

Format using Markdown. (No HTML.)
  • Code blocks: prefix each line by at least 4 spaces or 1 tab (and a blank line before and after)
  • Code span: surround with backticks
  • Blockquotes: prefix lines to be quoted with >
  • Links: <URL>
  • Links w/ description: [description](URL)
Created with Django | Hosted by Slicehost