Pages

Showing posts with label linux tips. Show all posts
Showing posts with label linux tips. Show all posts

How To Disable Root Account In Ubuntu/Linux

By default, a lot of Linux distributions disable the Root account (including Ubuntu). And the password for Root is generated automatically (using hash algorithms) while you install it on your HDD. So, unless you change the Root password manually, the Root will be deactivated by default.

Although there are both good and bad things about root privileges in Linux, yet, it is recommended to disable the Root account unless you really need it and whenever you need to act as an administrator, then use the "sudo" command instead. So, in that sense, if you want to know how to disable it, it can be done pretty easily via the Terminal.

Open your Terminal and issue the below command...

sudo usermod -p '!' root
 

How To Forcefully Un-Mount a FileSystem/CD,DVD in Linux

Unlike in Windows, once inserted a CD/DVD, Linux automatically locks the drive. So until it is properly unmounted, you won't be able to eject (not even via the "eject" button either) the media.

But sometimes, if your CD or DVD is damaged and Linux is unable to read it but it doesn't seem to stop soon on most occasions, until the OS "decides" it is unreadable (only it knows when >:( ), you'll have to wait!.

But fear not my friends :), there is a way that you can "forcefully" unmount any mounted volumes in Linux using the Terminal.

Now, I assume that your default mount point for the CD/DVD drive is "sr0", but as said before, not only CD/DVD drives but you can unmount any drive (including HDD partitions) with this command, just replace the "sr0" with your device mount point.

So, open your terminal and issue the below command...

sudo umount -f /dev/sr0

Now, you'll be able to eject the disk using the button or just enter the below command in your already opened terminal...

eject /dev/sr0 

That's it :).

How To Enable Computer, Home and Trash Icons On Gnome Desktop

Not only in Ubuntu, but in general, most of the Linux distributions come with computer/home and the trash icons disabled in Gnome desktop. In fact, maybe this has nothing to do with the "distribution", it may well be a predefined setting applied by the Gnome desktop

Although you can easily create shortcuts via dragging those icons from the "Places", in main menu, but still they'll show the shortcut arrow (which is changeable of course) + since they are just standard shortcuts, you won't be able to access the original "properties", etc on Computer or the Home folder for instance either.

So if you want to know how to enable these icons on Gnome desktop (I'm using Ubuntu 10.10 for this tutorial), then this is how you do it!.

1. Open your Terminal and issue the below command,

gconf-editor

Note - Don't use the "sudo" attribute, because if you do so, the settings will be applied to the Root user, not to your current user account. 

2. This should bring the Gnome configuration editor (a Gnome desktop setting manager, which are kept separately per users), see the below screen-shot.

The Gnome configuration editor main window...

3. Now from the window, go to (from the left side), "apps" -> "nautilus" -> "desktop".

4. After clicking on the "desktop" menu, you should be greeted with the below window.






5. As you can see, four settings with check boxes are unchecked by default. So all you have to do is check the appropriate box to enable that icon on your desktop!.

For instance, if you only want the "computer" and the "trash", icons to be visible, then simple check the boxes in front of those settings (OK, it sounded like a bit of disrespect to your intuvision, but I had to be precise :) ). 

After making the changes close the window and you should see those icons back on your Gnome desktop!. Any questions ??....

What Is The Difference Between "su" and "sudo" Commands In Linux?

The "sudo" was implemented on major Linux distributions (including Ubuntu and Fedora) few years ago. Although the history of sudo goes back as long as 1980's, but until recently it's usage was somewhat, limited. So, please be kind enough to let me give you a basic understanding "of" and for what the name "sudo" exists for :).

Funny but it's true tough :(...

The "su" part stands for "substitute user" and the "do" part represents the notion of running a command using another user's privileges, which is in this case, the Root. Root in both Unix and GNU Linux is the single most powerful user (originally accessed via the "su" command). There is nothing the Root user can't do in Linux (including the complete deletion of the system partition as well :( ).

So, when set-up, "sudo" let normal users to run programs that require administrative privileges without having to log in or become the dangerous "Root/su" user.  

Here is an example of how this can be used (a demonstration of running nautilus with Root user privileges by a normal user, using the "sudo" command),

sudo nautilus

As anyone can see, that was the problem with the "Root" user. If you don't know what you're doing... then the Root can do some heavy damages. So let's have a look at few of the disadvantages which gave birth to the "sudo".

*. Dangerous - I don't think you need any more info on this one as I said before, if you can't handle "it", you should not use it (ha.. you already wanna login as the Root don't ya...)

*. "Open" to attacks - Let me put it this way, for a hacker to start doing something naughty, first he needs the name of the User to begin with. Since, Root exists by default and cannot be changed (the name), now all he has to do is try to find the password. Although you can make things more secure by giving a strong password but still, it is by default, somewhat, "risky".

*. Hard to trace - When you do your things as the Root user, the OS does not create any history concerning who or when, etc .... nothing... nada!. So, if few people had access to your Root account then it is pretty hard to figure out who did it.

Although I'm pretty sure there is a long list of disadvantages, but these are the few most important ones. So, to avoid these difficulties, the "sudo" command was embedded by Linux developers and by default Ubuntu and Fedora disables the "Root" user.

Let's have a look at some of the good and bad aspects of sudo.


The Good

*. More secure against hackers - As said, it is easy for a hacker to try to break into your OS if he knows where to begin with (in this case it is the name of the user). But since your user names are hidden by default, first they have to find a name.

*. Single password - If you want to use the Root user privileges, then you have to enter a separate password. So you have to remember two passwords. But, since sudo let the normal users act as the "Root" by using the same password, now you only need to remember one password.

*. Automatic log-off - The session of a sudo expires within 15 minutes of entering the password in your Terminal. After that the system will ask for it again (although you can change the time frame nonetheless).

This is a very good thing, since, say that you had to go somewhere (to hide from your ex-girlfriend ;-) ) for few mins but forgot to lock the screen, then someone can easily do some damages to the OS via the sudo privileges.

*. Assign temporary "Roots" (with certain restrictions) - Say that you're an administrator of a network and a user asked for administrative privileges, then you can avoid giving him the Root privileges or sharing the password, now you can easily assign him/her temporally to the "sudo" system. So you don't have to "share" the Root which is not a good idea.

Two bad things about it

*. Easy access - If not set-up properly, then hackers can gain full access to the "Root" account which is superior to the sudo thus enabling them to do whatever they want!.

*. Password may be easy to obtain - Now, say that while installing your Linux you create a user account and gave a weaker password. As you can remember, the OS will make you eligible to act as the "sudo" by default. Anything with a weak password is very risky, thus in this case, a hacker might be able to guess your user account password easily, thus gaining access to the "Root" user.

Again there are a lot of bad and good things about these two SU and SUDO, but I'm not gonna write it since all I wanted was to give a brief introduction (ya!.. nice job, you wrote a book man ... I know, sorry about that :) ) concerning the subject. Hope this helped to clear some clouds.

Install GRUB Customizer (GUI) for Ubuntu 10.10

If you dual boot or just use Linux only, in either case the installer will automatically install a boot manager called GRUB (or LILO, depending on the distro). Not that long ago, after installing GRUB and wanting to change the names displayed in the boot menu or changing the time-out settings, it wasn't used to be that easy.

You had to manually edit a configuration file using the terminal or text-editor but still even changing something simple like boot menus was a bit risky unless you know what you were doing. But now it seems that those days are long gone, not only one, but there are a lot of applications that let you do that graphically!.



The one that I'm going to reveal is called "startupmanager". After installing it you'll be able to change the things like...

*. Time-out settings.

*. Boot sequence.

*. Boot logo's resolution.

*. Color depth change.

*. Remove text or logo during boot, etc are just a few to name.

So, open your terminal and issue the below command...

sudo apt-get install startupmanager

After installing it you should be able to execute it via "System" -> "Administration" -> "Startup-Manager" and make all those above mentioned (+ many more) customizations to the GRUB loader graphically.

How To Change The Root's Password In Linux/Ubuntu

When you first install Ubuntu you're asked to create a default user account to which the system automatically adds up administrative privileges (not as powerful as root but some privileges).

But if you want to be the real root of your system by using the "su" command in Terminal then when you're asked for the Root password, then you're stuck at it unless you change the default password (which is chosen using a random hash during the installation process) to a desired one.

So, without using any GUI tools, how can you change the Root's password in Ubuntu or Linux in general. We'll it it's simple actually, first open your Terminal and issue the following command...

sudo passwd root

Now you'll be asked to give a new password (twice), then enter the desired one. But remember, by default the root password is chosen as said before by using a random hash, so, if you override it using a weaker password, then your Linux may be easily hacked. So when choosing a password, make sure to give a strong one!. 

How To Install IDM In Ubuntu Linux 10.10

IDM or internet download manager is one of the best commercial applications that you can use to download files  many many times faster than the default built in utility that comes with the Microsoft windows OS versions. But let's say you're and addicted IDM user who switched to Ubuntu 10.10 maverick meerkat recently, then you'll most probably miss that great little app!.

A real screenshot of IDM in Linux!
And since it is a well known fact that MS Windows applications won't run in Linux.... well not quite true actually!, you can run some of them, even better than they run on Messy windows ;-)!. Although I'm not going to write a post about what that application is all about or how it does that but will give the basic understanding.

It is called the Wine project for linux. After installing it on Linux, it'll let you run most of the softwares that are built to run on MS windows on your newly installed linux distro!. So before installing IDM, you have to first set up wine on ubuntu 10.10. Now first...

1. Don't be afraid and start your Linux terminal first

2. Then issue the command below:

sudo apt-get install wine

3. Now when asked give your password and it'll automatically install all the necessary packages (Note- this may take a while since the it is a little over a hundred MB's.....)

After the installation finishes it'll add its own menus to the Gnome/KDE desktop task bar menus for ease of access. Now whenever you want to install a ".exe" file under Linux just right click on it and you'll see a newly added menu called “Open With Wine Windows Program Loader”.

Now just go to your IDM downloaded package (setup file), make sure to have a bit older version 5.18 (build8) or lower one, it may or may not be able to run the latest version....

1. Right click on the setup file and from the menu choose the above stated "Open With Wine Windows Program Loader" from the menu.

2. Now as in windows just follow the instructions and when in confusion just select all the default settings

3. Click finish at the end.

Now if everything went well you'll see that "beautiful" (hurray!!!) looking IDM icon on the Notification area on linux. Now functions such as automatic URL grabbing might not work but you can always copy and paste that URL manually into the IDM GUI or use the "Drop Target" feature.

That's how you install IDM in Ubuntu Linux 10.10

Ubuntu Linux Now Runs on Your Nexus S Smart Phone!

Ubuntu Linux is really something isn't it?. I mean it started with the PC and Laptops and the later went on to grab the Netbook market. Now according to some of the xda developers, they've found a way to run this on the latest Google phone the Nexus S!. This OS however is not the default Ubuntu Linux but a xda customized version which is at the 0.3 version currently (which is especially made out to run on HTC HD2).



Now according to them it isn't perfect yet and the touch screen is not working yet (ouch  - after all isn't that the most important part of your smart phone these days...). But don't worry since this customized Ubuntu won't replace the current anderiod OS on the Nexus S. So if anything goes wrong or you don't like it then just simply remove it.

Wi-Fi and 3G seems to be working at the moment. And if you're using the older Nexus One then you will have to use or build your own Kernel package at the moment otherwise it won't work since it is only for the "S" at the moment.

For downloading and other discussions concerning this Linux on Nexus S please click here for the xda forum.