2

I recently got my new Dell laptop with Ubuntu pre-installed. However, I accidentally skipped the first time setup, where you usually configure things like timezone and user(s). So now on boot I only have guest session available. So my question is: can I rerun the first time setup? If not, how can I add a user?

I followed advice of this question (How do I reset a lost administrative password?) and managed to create a user, but I cannot login in DE with it as it does not have home directory and probably something else.

I am using Ubuntu 16.10.

Mikhail
  • 143

2 Answers2

3

After login as root you should use the command adduser <username>, that will create a new user, home directory for it, etc. Alternatively when the user is already created you can create its home directory manually:

mkdir /home/<username>               # Make the user's home directory
cp /etc/skel/* /home/<username>/     # Copy the content of the skeletal dirirectory
chown -R <username>:<username> /home/<username> # Change the ownership

Finally you must add this user to the sudo group, thus it will have administrator's (root's) privileges - you can use either: usermod -a -G sudo <username> or adduser <username> sudo.

pa4080
  • 29,831
0

You could use Ubuntu Live version to boot your laptop, chroot to your system installed on laptop and then add new user. - For the first part use this tutorial: https://help.ubuntu.com/community/LiveCdRecovery - For the second part look here (add user from command line section): https://help.ubuntu.com/community/AddUsersHowto

mariaczi
  • 419
  • Thank you for your answer! I managed to add user without livecd already; I can login with it on TTY, but not on login screen. AFAICS, your answer does the same, which I already have. – Mikhail Mar 14 '18 at 10:12
  • So please check if this new created account have home directory running this command: ls -l /home If not, you can create it using mkdir command and then change the owner of this directory to the new account. Second way is remove and create the account once again. Look on the second link provided by me in my answer. Check the differences between adduser and useradd commands ;) Regards. – mariaczi Mar 14 '18 at 10:19
  • You do not need to do so complicated things while the recovery mode is accessible. – pa4080 Mar 14 '18 at 10:31