Wyoming, NSW 2250


cs@ct.gs

Menu
  • Services
  • Internet Access
  • Support
  • Links

Ubuntu Account Creation

16 June 2022
| No Comments

To create a new user account in Ubuntu, replace new_user with the username you want to add in the follow commands.

sudo -i

An interactive root session avoids a lot of sudo prefixes.

adduser new_user

will create the user account, prompting you for user details and a password.

usermod -a -G www-data new_user

will add them to the www-data group, such as for web admins. Replace www-data with the groups they should be a part of.

chage -m 0 -M 99999 -I -1 -E -1 new_user

will remove the password expiry so that the user doesn’t need to change a password regularly

usermod -a -G sudo new_user

will give the user sudo permissions if they require this level of access

mkdir /home/new_user/.ssh
cd /home/new_user/.ssh
ssh-keygen -t rsa -b 4096 (enter './id_rsa' when prompted)
chown new_user:new_user /home/new_user/.ssh/ \
   /home/new_user/.ssh/authorized_keys \
   /home/new_user/.ssh/id_rsa \
   /home/new_user/.ssh/id_rsa.pub
chmod 600 /home/new_user/.ssh/authorized_keys /home/new_user/.ssh/id_rsa
chmod 644 /home/new_user/.ssh/id_rsa.pub
chmod 700 /home/new_user/.ssh

will create the SSH key directory and generate a new key for use when logging in to the Ubuntu system via SSH. The final permission settings are necessary as an SSH session won’t be allowed when the keys are not restricted on the file system.

cat /home/new_user/.ssh/id_rsa

will display the content of the private key file, which will need to be provided to the user to allow them to access the Ubuntu system.

Finally,

exit

your elevated session.

Categories:Linux Issues
| Tags: Linux, Login, SSH, Ubuntu, User

Post navigation

← Find Node.js instance on a server
Create an App icon for a website in Linux →

Recent Posts

  • Bulk Converting HEIC to JPG in Linux
  • Sangoma S500 & S505 SIP Phone Factory Reset
  • Ubuntu – change lid and button actions
  • Create an App icon for a website in Linux
  • Ubuntu Account Creation

Recent Comments

    Archives

    • December 2022
    • November 2022
    • August 2022
    • June 2022
    • April 2022
    • February 2022
    • January 2022
    • September 2021
    • July 2021
    • January 2021
    • May 2020
    • November 2019
    • October 2019
    • June 2018
    • June 2016
    • June 2011

    Categories

    • Advanced Issues
    • Linux Issues
    • Windows Issues

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    About Us

    CT Group Pty Ltd provides services to select customers in Australia, our range of services, including: - Graphic Design - Web Design - Web Hosting and Domain Registration Services - Bookkeeping - We also maintain our support pages with information collected from over twenty years in the computer industry, along with our many resources on our links pages.

    Latest Posts
    • Bulk Converting HEIC to JPG in Linux

      With each revision of hardware, Apple continually…

    • Sangoma S500 & S505 SIP Phone Factory Reset

      If you don’t have the password for…

    Contact Info

    0407781204

    cs@ct.gs

    Server Status
    Copyright © 2021. All rights reserved
    Design by CT Group Pty Ltd