Wednesday, October 5, 2016

HOW TO PERSONALISE YOUR UBUNTU MACHINE


How to add my name in login page and home folder




You cannot do it when you get a used laptop and you are logged in with some other logins you got.

For that we need to login to a TTY terminal provided by Ubuntu.

What is a TTY?

Early user terminals connected to computers were electromechanical teleprinters or teletypewriters (TeleTYpewriter, TTY), and since then TTY has continued to be used as the name for the text-only console.
There are 6 virtual consoles in Ubuntu accessed by the keyboard shortcuts Ctrl+Alt+F1 to Ctrl+Alt+F6. You can move away from a text-only console (move the console to the background) by using the keyboard shortcut Ctrl+Alt+F7 
On some systems it is Alt+F8 or Alt+F9, on others it is Alt+F7. The Ctrl is not needed to come back from the tty, only to drop to it.
The actual F key depends on which tty your X session is running in. As far as I know, the default value is 8 (or 7) so Alt+F8 should do it. If not, just try the other values until you hit the right one.
As @mantawork points out in the comments, a generic way is Alt+Left Arrow while in terminal 1. In general Alt+Left Arrow or Alt+Right Arrow will cycle through the ttys. If you repeat that you will eventually be taken back to the one that has your X session.
Thats all about TTYs

Continue...

So do  Ctrl+Alt+F1  

Unix(-like) operative systems decouples the user name from its user identity, so you may safely change the first without changing the other. All permissions, files etc are tied to your identity (uid), not your username.
To manage every aspect of the user database, you use the usermod tool.
To change username (it is probably best to do this without being logged in):
usermod -l newUsername oldUsername
This however, doesn't rename the home folder.
To change home-folder, use
usermod -d /home/newHomeDir -m newUsername
after you changed the username.
Some additional information for not so experienced users:
As I only have ONE user account (administrator), it would not let me change the username ("you are already logged in" was the response in TTY1 (Ctrl+Alt+F1). I found some information to get around this:
  1. Add a new user, e.g. "temporary". If you are still in TTY1:
    adduser temporary
    
    set the password and remaining details 
  2. Add the user to sudo group
  3. usermod -aG sudo temporary
  4. And just type exit. This should bring you to the original login prompt. If not, type exit again.
  5. Change the account type of your new temporary user to administrator:
    In tty7 (Ctrl+Alt+F7, "normal" desktop) login in to your usual account. Change his privileges through the gui: System settings > users account. Click Unlock then change account type to "administrator".
  6. Log out again.
  7. Return to tty1: Login with the 'temporary' user account and password. Change your username and folder as mentioned above. exit (until you get the login prompt)
  8. Go back to TTY7 (Ctrl+Alt+F7) to login on the GUI/normal desktop screen and see if this works.
  9. Delete temporary user and folder:
    sudo deluser temporary
    
    sudo rm -r /home/temporary