Posts Tagged ‘Linux’

no “setup” command – CentOS

7 Comments »

 

I usually use “setup” to do the firewall setup for permissive or not and setting of SELINUX, etc….

But on a minimal install you don’t have access to setup command, which is my favorite

[root@tel ~]# setup
-bash: setup: command not found

So how to install it in minimal install ?

yum –y install setuptool
yum –y install system-config-network*
yum -y install system-config-firewall*
yum –y install system-config-securitylevel-tui
yum –y install system-config-keyboard

(thanks JoVeN for spell mistake)

For system services utility install ntsysv (as Perico suggested in the user comments)

yum -y install ntsysv

setup-CentOS

That’s it….!! Enjoy


Install XWindows (Graphical mode) in Linux

4 Comments »

 

If you recently installed linux (CentOS/Fedora/RedHat) with text mode and now want to use its Graphical GUI which was left unchecked during the installation, you can install it from Internet very easily.

Read the rest of this entry »


How to mount a partition on a disk that has an EFI GPT partition table in Linux

2 Comments »

 

How to mount a partition from a large disk (above 1TB) that has an EFI GPT partition table instead of the conventional MBR (Master Boot Record) partition table. A large disk means a hard drive that is 1 Terabyte or more. EFI stands for Extensible Firmware Interface. GPT is short for Globally Unique Identifier Partition Table.

GUID_Partition_Table_Scheme

First Step)
Check the kernel was compiled with EFI support. The standard kernel with Ubuntu/Debian/CentOS  5+ comes with EFI support built-in

cat /boot/config-2.6.26-2-686 | grep EFI

(Change the version number with yours in /boot/config-*)
if the kernel was compiled with EFI support if you get these lines:

CONFIG_EFI=y
CONFIG_FB_EFI=y
CONFIG_EFI_VARS=m
CONFIG_EFI_PARTITION=y

Then type

fdisk -l

(to check the device name in /dev)

fdisk -l /dev/sda

(if the device is at sda, replace with the one you saw when you typed fdisk -l)

parted /dev/sda print

Ok we got the filesystem with the above command, now lets mount it!

mkdir /mnt/test
mount -t ext3 /dev/sda2 /mnt/test

(if the file system is ext3, it will be displayed when you type “parted /dev/sda print”, if device is at /dev/sda)

Hope this helps


Mounting Windows based shares in Linux

No Comments »

 

Mounting Windows based shares on Linux is a relatively simple process.

If the share is on a Windows XP, Server 2000 or NT machine you can use the following command:

mount -t smbfs -o username=username //server/share /mountpoint

However for Server 2003 the above command will not work so you simply change smbfs for cifs as shown below.

mount -t cifs -o username=username //server/share /mountpoint

The username should be that of your Windows user and in both examples you will be prompted for your windows password.

The command above will work for all versions of Windows. If you are having difficulty mounting or receive an error with invalid file type ensure that the samba-client packages for your distribution are installed


Reset Webmin admin/root Password

3 Comments »

If you just forgot our webmin admin password and failed to logging to your webmin account and after several tries your Webmin blocked your IP you need to follow following steps to reset your webmin admin/root/master password:-

  1. Login to your box as root.
  2. If you are running a RedHat distribution (i.e. Fedora, CentOS, Gentoo), enter the following
    /usr/libexec/webmin/changepass.pl /etc/webmin username password

    If you are running a Debian distribution, enter the following command:

    /usr/share/webmin/changepass.pl /etc/webmin username password
    
  3. You are almost done.

  4. Now you can Login to Webmin with your new password you just reset.

How To Reset ROOT (or any user’s) Password in Linux distro

2 Comments »

The root user can change the password for any other user. However what if you forget your root password?

To reset your root password (or any other account’s password for that matter), there are essentially two different situations which require varying approaches

When you can use Boot Loaders (GRUB / LILO)

If you have GRUB installed and you have accesses to edit boot parameters of selected entries then the job is as easy as it can get. Follow along and you shall have root access in no time. Once you have root access you can pretty much do anything you want to do!

  • Highlight the GRUB entry for the Linux installation that you want to reset the password for.
  • Press ‘e’ to edit. Select the Kernel line. Add ‘single’ at the end of the kernel line, Press ENTER and then Press ‘b’ to boot. If your system still requires you to enter the root password, add init=/bin/bash at the end. Press ‘b’ to boot.
  • Please note in some distros 'single' can be, 'linux single' , 'run level 1' etc.

GRUB Boot Loader

  • Either you would be taken to the root prompt directly or shown the recovery menu from where you can choose the root prompt. Use passwd <username> to change the password for any account.
  • Type reboot to reboot the system and then log in in with your new password.
When you can’t use Boot Loaders

If you are unable to use GRUB for whatever reasons (like password protected entries) you can still reset the password using a Live CD (I will be using Ubuntu Live CD, you may use any other). Just follow the steps below to achieve this:

  • Boot from the Live CD (Download Link) (Aslo you can try USB drive to boot after downloading .ISO file, try this)
  • Choose
    Try Ubuntu without any changes to your computer” 
  • When the system is ready, fire up a terminal window (CTRL+ALT+F1) and get ready for some command line action
  • Type sudo fdisk -l.
    In the output we are concerned to know which partition Linux is installed on and what name the hard disk is using. (e.g) in my case it is /dev/sda1 is the required partition. If you are sure about the partition you can skip this step
  • Next we need to mount the Linux partition. Create a directory to act as mount point for the partition. Use ‘sudo mkdir /media/masterdrive
  • Mount the linux partition using the command ‘sudo mount /dev/sda1 /media/masterdrive
  • Change Root to the mount directory – ‘sudo chroot /media/masterdrive
    (if no /bin/bash error, then try other partition=> sudo fdisk -l)
  • Type sudo passwd and then enter the new password to change the root password.
  • OR type password <username> for anyother user
  • Type sudo reboot to restart the system.
  • You just recovered your root password.