sometimes a cigar is just a cigar
Header image

User groups and Users in Ubuntu

Posted by ALonon in Linux

Today, i opened a new user (account) and gave ssh access a user on my linode vps.

  • Opened new group
  • Created new user
  • Changed user group
  • Check user group is true
  • Giving ssh access to user
  • Restarting sshd
  • Lets firstly add a user in Ubuntu

    sudo adduser USERNAME

    Create new group in Ubuntu

    sudo addgroup GROUPNAME

    Change user group, you can do it with two way. You can edit file or delete user and add again with group

    sudo vi /etc/group

    change

    GROUPNAME:x:1002:USERNAME

    or delete user and add again

    sudo userdel USERNAME
    sudo useradd USERNAME -g GROUPNAME

    Check user group or learn user group in Ubuntu

    id USERNAME

    Give ssh access to a user in Ubuntu

    sudo vi /etc/ssh/sshd_config

    change

    AllowUsers alonon OTHERUSERNAME NEWUSERNAME

    than

    sudo service ssh restart

    Also you can delete a user in ubuntu with

    sudo userdel USERNAME

    Group delete in Ubuntu

    sudo groupdel GROUPNAME

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>