Sunday, December 27, 2009

Recover Forgotten Ubuntu Password without reinstalling

If you forgot you password for your ubuntu system you can recover using the following steps

Turn your computer on.

Press ESC at the grub prompt.

Press e for edit.

Highlight the line that begins kernel ………, press e

Go to the very end of the line, add rw init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

Type in passwd username

Set your password.

Type in reboot

If this doesnt work you can alternatively try this:

Turn on your computer, and as soon as you the Press Esc to enter grub message, press the escape key.

Select the option that says (recovery mode).

Your PC will boot into a shell. Once you get a command prompt, type "passwd username" where the username is your username.

Enter a new password when prompted, and again when prompted again

Type reboot to reboot your system

Another way is to boot into the system via a live cd open up Applications->Accessories->Terminal
then mount your ubuntu drive if its on /dev/sda1 do this:

mount /dev/sda1/ /media/sda1

Then we chroot into the system:

chroot /media/sda1

passwd user

Now change the password, and reboot your box!

Ref http://www.ubuntu-unleashed.com/
Read more

Tuesday, December 15, 2009

How to install OpenSSH in Ubuntu to connect to another computer

OpenSSH encrypts all traffic including passwords to effectively eliminate connection hijacking or eavesdropping on the traffic. SSH was designed as a replacement for Telnet,rlogin and rsh, which send information, notably passwords in plaintext leaving them open for interception. OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions.
This will all be done in Terminal.

Type the following two commands to install both ssh client and server:

sudo apt-get install openssh-server openssh-client

You can do the same for the other pc or just install openssh-server if the pc is just going to be a server.
To log in you would do the following:

ssh yourusername@remotepc (ex. ssh bob@192.168.1.1) if the two computers have the same username you can just do ssh 192.168.1.1
you will see a message like this
Host key not found from database.Key fingerprint:xezop-fomas-lifot-pisoc-zyvik-hutoz-bafaf-zapyc-lubev-riked-dexax
You can get a public key's fingerprint by running% ssh-keygen2 -F publickey.pub on the keyfile.
Are you sure you want to continue connecting (yes/no)

Type yes and it will add the RSA key this will only happen once, that is it. By default OpenSSH will be listening on port 22 but I would change that to a port of your choice for security since a network port scanner like Nmap can be ran by intrudes.
The configuration file is in /etc/ssh/sshd_config
we can use gedit to modify this:
sudo gedit /etc/ssh/sshd_config you will see #Port 22 remove the # and change the port number to something like 3787, now save the changes.
Now since we changed the port number the command to use ssh will be ssh -p222 192.168.1.1 (-p tells ssh what port to use)
Other commands that can be used if needed are:
  To stop server:
sudo /etc/init.d/ssh stop

  To start server:
sudo /etc/init.d/ssh stop

 To restart server:
sudo /etc/init.d/ssh restart
SSH is one of my favorite programs. I would advise to look at the man pages by typing man ssh to view all the options.
Read more

Thursday, December 3, 2009

Reclaim Disk Space

Filling a partition to 100% can have an unpleasant effect on your system. When services and other programs cannot write to their log files, or cannot save data in /var, you could be in trouble. These programs won't be able to save their data, and typically quit out (or, in some extreme cases, crash dramatically!). To avoid this, the ext2,ext3 and ext4 filesystems reserve 5% of their capacity for only root processes to use. This is a good idea, but 5% is a lot on large drives - for instance, it's 25GB on a 500GB drive. Also, there is no need to reserve any space on a filesystem not used for root files, such as /home.

The good news is that not only is this 5% not hardcoded into the filesystem, it can be changed on the fly without disturbing the your data and files. Tune2fs is used to tune various parameters of an ext2,ext3 and the new ext4 filesystem. It can be used to change the volume label or the number of mounts between forced execution of fsck and a host of other, more esoteric settings, but the options we are interested in here are -m and -r. The former changes the percentage of filesystem blocks reserved for the root user, while the latter uses an absolute number of blocks.

Example: tune2fs -m 2 /dev/sda1

reduces the reserved area to 2% of the filesystem, which may be more appropriate for if you have a large / or /var filesystem. If you're using a drive of 500GB or larger, this is the best option.

This line of code:

tune2fs -m 0 /dev/sda1

sets the filesystem to have no reserved blocks, a good setting for /home that doesn't need a reserved area for the superuser.
Read more

Wednesday, May 27, 2009

GNU? Linux? Oh, Ubuntu!!!

In the open source community we forget sometimes that non-techie individuals or Windows tech people don't understand what we are talking about. An example is just in this title GNU which is a recursive acronym for GNU's not Unix. Living in the FLOSS(Free Libre Open Source Software) community, we are generally limited to a small social group which really isn't that small since their are millions of users around the world. I decided to write about this in my blog due to a conversation I had with two individuals. I was at a cafeteria when I was approached with comments reference my EEEPC. Since I'm a Linux advocate I assured to let them know that is was running Linux. I just assumed that people would know the word Linux, but now that I look back in time even I didn't know what it was before I ran it. They saw my wallpaper that had an Ubuntu logo on it with the words Ubuntu and they pointed to it and said I know what that is. You see in my community it all makes sense because I know my community but to others it is just odd. Their are just to many names for Linux. People are use to one name systems like Windows or Mac. Do we call the system by what the Free Software Foundation calls it GNU/Linux or just Linux. To get to the bottom of it the name Linux really means the heart of the system the kernel, in return we use that as the name. Linux has many distributions Ubuntu,Fedora,OpenSuse,Debian,Slackware just to name a few. Now with Ubuntu standing out in the public eye it is used to define Linux which really isn't fair to the rest of the distributions. I know that people will not comprehend entirely which is ok but we need not to scare some people off by name confusion. Maybe by using the word Linux after the distributions name will help like Ubuntu Linux, Fedora Linux. Well, anyway that is my thoughts for this post.

Read more

Monday, May 11, 2009

Media Center Update

Installed Ubuntu 9.04 64bit,Mythtv and XBMC on my media center. The stats of the media center are as follows:
Thermaltake Tenor case
ECS KN1SLI 939 board
Nvidia 9600GT
Hauppague HVR 1800
750GB Seagate
Asus DVD
2 GB RAM
Most of my movies are on this box which is very convenient,
my music collection is on my Quadcore desktop box which
I just SSH into to access which saves space on the hard drive.
Can't wait for my next project.
Read more

Wednesday, April 15, 2009

New Server Setup

I have been running an Ubuntu server for a while now. It comes time to try something different. CentOS 5.3 was just release not to long ago and this will be my new adventure. I have worked with a Red Hat server prior and since CentOS is basically the same thing I will be familiar with it. The new server will feature Apache of course with MySQL and Drupal.
Read more
 

Shaun Mallette's Blog Design by Insight © 2009