Tuesday, May 7, 2013

add additional logins (ttys) to ubuntu OS and make them auto-login as any user without password

I like ubuntu, I hate the default terminal setup. This shows how to change from this:

Terminal Sessions: 
        ALT+F1 to ALT+F6 (tty1,tty2,tty3 ... tty6)

Graphical Sessions:  
        ALT+F7, ALT+F8, ALT+F9 ... etc 

to this:

Terminal Sessions:
         ALT+F1 to ALT+F12  = tty1 thru tty12

Graphical Sessions:
        SHIFT+ALT+F1 to SHIFT+ALT+F12 

* when using the above keystrokes remember to also press CTRL
  if you are already in a GUI window (this applies to both GUI
  keys and text terminal keys!)

This gives you 12 text terminals AND 12 GUI terminals PLUS
it is really easy to remember (i get tired of accidently pushing ALT+F7 when i mean to press ALT+F6 or vice versa, then the GUI requires you  to use CTRL+ALT+F6 to get back to it. This is much easier I think, and here's how to do it (this works on Ubuntu 12.04, 12.10 and 13.04 and may work with other versions as well). The steps are:

1) get to a terminal where you can log in as root. If you cant log in as root you will need to put "sudo" before all the commands in these instructions. If you just installed and cant log in as root but want to, heres how to enable the root account:
login with your usual username/password, at the prompt type "sudo su root" (enter YOUR password at the prompt if asked), at the next prompt type 'passwd' and you will be prompted to create a password, when done you can type 'exit' to get back to your account, now you can login as root using that password you just created! Now that you are logged in, go to the next step...

2) to change to the upstart configuration directory type:

   cd /etc/init

3) here you will need to copy the existing terminal configuration files to new ones for the new terminals youre about to create for tty7,8,9,10,11 and 12.

4) copy the new files by typing:

  for (( i=7; i<=12; i++)); do cp tty1.conf tty${i}.conf; done

5) now you need to edit each of the new files you just copied. If you don't have an editor install this recommended one called nano by typing:

  apt-get install -y nano

  You can do this easily in nano (or something simmilar) by typing:

  nano tty7.conf tty9.conf tty10.conf tty11.conf tty12.conf

  NOTE: if nano complains about not having multiple buffer mode, you will either need to enable it or edit them one by one!

6) for each configuration file you will need to change the text 'tty1' to whatever tty the current file's intended for (for example change tty1 to tty7 when editing tty7.conf)

      search: tty1
replace with: filename (without the .conf, for example 'tty7')

6a) (optional) If you want auto-login for any particular terminal, you can make this change causing an auto-login instead of a prompted login even after exiting:

      search: "exec tty<n> -8 38400" 
replace with: "exec tty<n> -8 38400 -a <username>"

  (where <n> is the tty number you are changing and <username> you want to log in as (no password prompt will be given).

7) if you're using nano, just press CTRL-O to save, and CTRL-X to close the buffer. 


That's all! Now you can reboot using CTRL+ALT+DELETE or type 'shutdown -r now' at a prompt. The next time you boot, all your terminals will log in automatically (if step 6a was followed) and will be on the keys mentioned above, 12 text terminals ready to go!! BTW, the 12t-12gui setup i think should the default when installed on any system that has more than 1GB of internal memory. getty does NOT take that much CPU time since "sleeping" is almost the same as not running at all 'cept for the swap space/mempage used.

NOTICE: I strongly suggest not auto-login as root -- personally I dont believe in using root for anything except emergency situations where other accounts arent available and/or sudo cant be run. If sudo doesnt work the way you expect it to, you probably just need to use 'sudo -H' instead, some programs check the $HOME folder for their configuration (not the $USER's HOME folder). Keep root disabled as well as it can lead you to cause much damage to your computer. If you hate entering in 'sudo' all the time just alias command='sudo command' in your bashrc file. Oh yeah, and I purposely didnt tell you that everything above is under a bash shell, just to see if you are paying attention!! sorry :) But above all, do not use root(!), and REALLY DONT X as root(!!!) and REALLY REALLY REALLY dont start any web browser as root(!!!!!!!!!)

linux is powerful if you know how to use it, for example, i can set up my terminal to show the current outside temperature and wind speed right in my prompt, as well as just about any other info available on the internet in any protocol...!! dont let windows users tell you that KDE and cygwin run stuff just like linux in windows and dont believe that WUBI is an honest representation of Ubuntu's performance... I think they are supposed to get rid of WUBI as of 13.xx anyway, so that is one step in the right direction... last thing we need is a bunch of ex-windows users here right? (points the finger at herself). Damn ranting, gotta go! -o

Standards that shouldn't be...

I've now been diving into the developer's final frontier: linux.  As Windows is "England" (in the 1600s) as is Linux to "The Americas" or more properly "The Amerigos" Makes you wonder how many things in history are typos.  Would you still worship Jesus if his name was actually Kevin Smith?  No pun, standards that should never be in Linux have been for far to long. And standards that should be just aren't.  Another good example, I read an article, cant remember where, like anyone cares, that stated that freedom of interface in Ubuntu should be crucial. In many cases, it is... no standardization because everyone bitches (the linux haters call them 'freetards') whenever something gets standardized by canonical. They dont want another company like Microsoft. But wait, last time I looked, Microsoft was the most popular OS right??  Linux can't even dream of competing UNLESS they get a corporation (like canonical) to fight in the ring. You don't get to put 400 weaklings in the ring with one 5000lb giant, regardless of their numbers, they still get squashed. In this article I read, it said that "do I want settings to be in a centralized system like the registry, hell no!" which, this is another thing: who likes firing up man everytime they need to find out where settings are saved on a program they are using or just installed. At least in windows you pretty much can guess where stuff is going to be stored, and 99% of the time you are right, and if you are wrong, 99.999% of that is in the second place that you guess... only .0000001% of the time do you need to fire up the documentation to figure out where files are kept. THIS IS A BIG problem, almost as big as the hardware thing.  If we developers can't start agreeing to let companies like Canonical make the big decisions for us, there will never be real competition between windows and linux.  I will agree that it's nice to be able to run 3 different window managers under multiple users at the same time and across networks etc, but that stuff isn't going to get hurt if standardization doesnt hurry up and get in the game.  Perhaps what we really need is a front-end that can detect the multitude of different setting algorithims used and try to tie it into one clean interface. For example, upstart, which is backward compatible and has support for the old sysv init, and has some support for converting those old inits into upstarts, this is the direction the rest of the OS needs to go in. Man I hate having to pull out my hair all the time... do I HAVE to have xmonad's RED rectangle always or can it be green somehow?? You see? I'm ranting.. the day is over.