Tuesday, 22 April 2008

Ubuntu: Use root password instead default user password

After clean install of Ubuntu, you noticed u have to enter your user password to do administrative or system tasks. This is the way to change it.
First make sure u set password for the 'root' user:
sudo passwd root

Use your favorite text editor and edit '/usr/share/gconf/defaults/10_libgksu' file.
Change:
/apps/gksu/sudo-mode true

to:
/apps/gksu/sudo-mode false

Then issue following command:
sudo update-gconf-defaults

Saturday, 12 April 2008

Fixing large fonts / graphics bug on Linux with intel driver

Problem with Intel drivers on linux which manifests like this: Click to see screen shot is easily fixed by adding this into /etc/X11/xorg.conf file:

Section "Monitor"
... #whatevert was in already.
Option "DDC" "no"
EndSection

Tuesday, 8 April 2008

HOWTO: compress and extract rar archives under linux

Quick how-to on extracting and compressing .rar archives. For this method it is essential that u have WinRar, hopefully installed on your windows partition.

1. Install wine. You can do it with Synaptic Package Manager under Debian
2. Copy 'rar.exe' from the directory where the WinRar is installed on windows partition to '$HOME/.wine/drive_c/windows/system32' on your linux system. If you don't have WinRar u should probably buy it :)
3. Now you can call rar comand with 'wine rar '. Type 'wine rar -h' for help.
4. Enjoy typing

It's possible to run WinRar GUI with wine, so that is another option, but I think this is quicker method.

Wednesday, 2 April 2008

Tutorial - Adding new user to your Linux system

In this post I will try to explain basic usage of commands considering user and group administration on Linux systems such as adding/deleting a user or groups, setting permissions and so on. Only superuser (root) is allowed for user/group administration so you'll need to login as a root user with the 'su' command. On my shell its like this:

~$ su
Password:
#


Perhaps its needed to add a new user for new person that needs to work on the system, or you will need to add a user and a group for some software package to work securely. Creating user or updating user information is done with the 'useradd' command. So let say I need to create new account for my mother who just found out how cool is Linux. Her username will be 'mom' and I'm gonna add her on the system now:

# useradd mom
# cat /etc/passwd | grep mom
mom:x:1001:1001::/home/mom:/bin/


With this command I simply added new user called 'mom'. Secondly I wanted to check out did it accualy succeed with the second command. Yes, mom is added in the '/etc/passwd' file. But what about hose other data? Every entry in 'passwd' file means is formated as:

[account name]:[password]:[user ID / UID]:[group ID / GID]:[home directory]:[shell]


We see that her UID and GID are both 1001, these numbers are unique to user 'mom' and her initial group (which is also called 'mom'). Mom's home directory is '/home/mom. The last parameter is the type of shell she'll use, in this case 'sh'.
Letter 'x' means the password is encrypted. But what is actually her password? I didn't type any password when creating account. Her password was randomly generated cause I didn't specify it, and I actually don't know it. But thats no problem, cause I know root password, and I can change any password for any user anytime with 'passwd' command. I'll do it now for mom:

# passwd mom
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


Now any user that knows her password can login to her account with 'su mom' command.
Now I'm noticing one other thing. I cannot go to moms home directory cause it doesn't exist, and I need to create one for her. I'll do it with this command:

# mkdir /home/mom
# chown mom /home/mom
# chgrp mom /home/mom


Now mom has her own directory in which she can put her stuff. Directory 'mom' also belongs to her 'mom' group. But I could have saved myself from the trouble if I just put '-m' option when creating her account like this:

# useradd -m mom


The 'm' option automatically creates user directory.
The process of creating a new user is over, I'll just change her default shell to 'bash' and change my file permissions so she can't digg through my files:

# usermod -s /bin/bash mom
# exit
exit
~$ cd ..
~$ chmod o= tvrtko


For further details of a particular command see the 'man' pages.