Using root (in terminal) in a user-level account might give you data insecure that may result in malware exploit in cross terminal exploitation. So, basically just use full root access.
Switching to root in a user-level account is quite a harsh thing to do.
So, it's better if you switch to root every time you log in simply by ->
First edit the file /etc/login.defs and uncomment the following line (remove the '#' in front):
NO_PASSWORD_CONSOLE tty1:tty2:tty3:tty4:tty5:tty6
You have to do that so it doesn't ask for a password once you log in.
Second, edit /etc/inittab. This file is a bit compicated so it helps if you're familiar with it a little, but if you're not just work on the following line:
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
You want to tell the agetty program to execute an auto login program (we will write this below). Replace the line above with the follwing:
c1:12345:respawn:/sbin/agetty -n -l /usr/sbin/autologin 38400 tty1 linux
The /usr/sbin/autologin program doesn't come with your system, you have to write it and compile it yourself, but it's pretty easy. First create an empty text file and add the following contents to it:
int main()
{
execlp( "login", "login", "-f", "shafiq", 0);
}
Replace shafiq with the name of the user you want to log in automatically and save the file as autologin.c.
Then compile the program like this (you have to be root for that to work):
cc autologin.c -o /usr/sbin/autologin
And that's it. When your machine finishes booting it will execute the autologin program which will log in as the user you specified in autologin.c and because you edited /etc/login.defs it won't ask for a password.
Now to execute a program after it logs in just edit .bash_profile in the user's home directory (create the file if it doesn't exist) and append the command you want to run at the end of that file, for example this is my .bash_profile, all it does is run pico:
pico
And if you feel unsafe of doing this, try to encrypt your BIOS during boot up. And let's see if anyone can open your device even at the very early booting up stage of whatever device you're using.
Regards.
su -
.