Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Monday, 23 September 2013

Windows setup cannot configure Windows to run on this hardware

Leave a Comment
     While installation of Windows some times after restarting Windows on last step "completing installation" this error comes and your installation never completes.
     To install Windows properly in such cases you can follow the steps given below

  1. Reset your BIOS to all default values and restart. Changes in BIOS may be the cause of this error.
  2. After restarting if the problem remains same then follow the steps below.
  3. Once again boot from your bootable CD/DVD or bootable pendrive.
  4. Don't delete/format the windows partition where you have installed your Windows 7.
  5. Select the same partition where you have installed your Windows previously and which is giving the error "Windows setup cannot configure windows while to run on this hardware" and install Windows on this drive once again.
  6. This will give you warning as shown in the figure given below, click on ok button and your installation start.
    Windows.old
  7. Now all your data of previous windows will get store on windows.old folder on the drive where you have installed the windows.
  8. You can delete this partition and make free space on the drive.
Read More...

Tuesday, 16 July 2013

Windows keep restarting

1 comment

This problem may occur due to different reasons such as corrupted boot sector, viruses. In my opinion there are two solutions to solve this problem

1. Using recovery console

Follow the steps given below but beware that after using this commands your other OS like CentOS, Ubuntu will be removed from the grub. Do to which you will not able to use your other OS installed with Windows.
  • boot your machine from windows bootable DVD or USB.
  • go to recovery console 
  • type the following commands 
    • bootrec.exe/rebuildbcd     (scan all disks which contain Windows installation)
    • bootrec.exe/fixmbr           (write new MBR)
    • bootrec.exe/fixboot          (Write new boot sector)
  • This commands search for windows installed drive and add those entries to grub.
  • After this shutdown the machine and start it.

2. Installing Ubuntu alongside windows

This is safer option than first one because this method keeps both the Windows,  Other Linux, and this new Ubuntu which you are going to install alongside windows. After installing Ubuntu all the grub entries go the Ubuntu, due to which problem get solved. By using this method you will be able to use two flavors of Linux (Ubuntu:-debian based + CentOS:- Redhat based + Windows) with Windows. This method require free disk space (minimum requirement of Ubuntu)on C drive (where your Windows is installed) to install Ubuntu alongside Windows.
By using this method we can also get CentOS back after removal of its entry from grub due to some problem and going to grub rescue.
Read More...

Tuesday, 11 June 2013

No valid sudoers sources found quitting ubuntu

1 comment
This error happen due to change in permission of sudoers file.
Pkexec command is used to execute command as another user. Older versions of Ubuntu don't support this command. If you are able to use pkexec command then you are not require to reboot and go to recovery mode use following commands

pkexec chown -R root:root /etc/sudoers.d
pkexec chmod u=rwx,g=rx,o=rx /etc/sudoers.d/
pkexec chmod u=r,g=r,o= /etc/sudoers.d/*


If you are running on old versions which could not support pkexec then you require to use recovery mode.
You can go into recovery mode by selecting grub menu ending with recovery mode option ->root -> give root password
after this enter command

fdisk -l (gives all detail disk partition)

Since in ubuntu recovery mode is read only you will require to remount in read-write mode using following command

mount -o remount,rw /dev/sda(drive containing installation i.e root)
now enter above commands without pkexec as below

chown -R root:root /etc/sudoers.d
chmod u=rwx,g=rx,o=rx /etc/sudoers.d/
chmod u=r,g=r,o= /etc/sudoers.d/*


now reboot and you will be able to use sudo or su command

Read More...

Sunday, 26 May 2013

passwd command not working in single user mode

Leave a Comment
If your passwd command is not working in single user mode and you want access of machine then first remove the password of root or any user already present as explained below. After removing password, login to that user without password and change password for the user by using passwd command.
You can remove the password by editing shadow file present in /etc/ folder with file name shadow
Shadow file format is as below
root:$1$CQoPk7Zh$370xDLmeGD9m4aF/ciIlC.:14425:0:99999:7:::

There are 6 fields separated by ':'. To remove password delete second field present in line with first field showing user name it should look like
root::14425:0:99999:7:::

This file is read only so after changing file you require to give command as wq! to save changes in vi editor (since in single user mode other editors won't work) this will change your file. If this is not working then you have to change the permissions of the shadow file. To change permission use chmod 777 shadow command.

Check the file is changed, if it is changed then you can restart by command reboot.



Read More...

Friday, 3 May 2013

Secure CoPy (SCP)- Secure Option to Copy Files in Linux

8 comments

 

1. What is Secure CoPy (SCP) ?

            SCP is a command used to transfer files or folders securely to a particular remote user. In windows sharing of folders or files can be done in LAN only. There is no facility provided to transfer data securely from one user to another remote user, we require to use service from some third party software to do so. In Windows you can get this facility by installing WinSCP software and transfer the files directly to the Linux OR you can install OpenSSH on Windows machine using cygwin which is a collection of tools which provide a Linux like environment for Windows operating system. After OpenSSH installation you can transfer files using SCP from Windows to Linux and from Linux to Windows.

2. How to Use SCP ?

           To use SCP, first you have to start ssh service on the other side where you want to transfer the data. To start the service in red hat based OS switch to root user and give the command as " service sshd start ", for debian based OS you can use " sudo /etc/init.d/ssh start " or " sudo service ssh start ". SCP requires password of the remote machine to copy files or folder, so you can keep ssh server running all time, no one can copy irrelevant material without prior authentication.
          After starting the ssh service of target system you can give following command to start copy.
Syntax to copy single file:
         scp file1.txt user@target_IP_Address:~/Destination_PATH 

Here, you require to provide user name with IP address of remote system as shown above. 
Here ~ is used to represent home directory of a particular user in Linux.
After entering this command you need to provide the password of the target system , if password is correct then your copying files get started.
To copy multiple files using SCP, you can give multiple file names separated by space. Files may have different extensions.

Syntax to copy multiple files:
          scp file.txt file2.avi file3.iso user@target_IP_Address:~/Desktop

To copy particular folder you can use SCP command with " -r " option which indicates recursive operation.

Syntax to copy single folder:
          scp -r folder_name user@target_IP_Address:~/Desktop


You can also copy multiple folders using SCP like we did with multiple files as given above. You can use following command to copy multiple folders using SCP command.

Syntax to copy multiple folders:
         scp -r folder1 folder2 user@target_IP_Address:~/Desktop 


3. Errors and solutions

  • One common error is " port 22: Connection refused " which occurs when ssh service of the destination machine is stopped. You can eliminate  this error by starting ssh service at the destination machine.
  • Another error is that your file or folder get copied to your own directory with user name followed with IP address like " user@target_IP_Address ". This error happens if " :PATH " is not mentioned in command.
Read More...

Tuesday, 30 April 2013

What is ssh ?

Leave a Comment

1. What is Secure SHell (SSH)

   SSH is a network protocol which uses public-key cryptography. SSH is more secure than rsh, telnet. Generally SSH is used to access remote machine using password authentication and to form cluster of different machines. You can also see GUI for file manager of remote system so that controlling becomes easier (nautilus for GNOME, krusader for KDE etc.). Generally in Linux, openssh provides SSH protocol. You can use PUTTY to act as SSH client for Windows OS. To install SSH server in windows you have to install CYGWIN. In Windows you can not get GUI through file manager as you do in Linux.
   CYGWIN is a collection of tools which provide a Linux-like environment for Windows operating system.

2. Installation

  • Many Linux OS images comes with this two required packages, openssh client and server already installed on it, but there are some basic images with around 700 MB which won't contain these packages.
  • To know whether you have SSH installed or not you can use the command  " which ssh " if it doesn't give any output then you will have to install it.
  •  To install SSH in CentOS use " yum install openssh* ". This command will install openssh-client and openssh-server for you.
  • To install SSH in Ubuntu use " sudo apt-get install ssh ".
  • To install CYGWIN in Windows please refer this video.

3. Uses

  • Machine with SSH client installed acts as client that can access other machine installed with SSH server.
  • Machine with SSH server installed acts as server and receives multiple request from SSH client.
  • SSH can be used to create cluster of different machines to run any job on cluster using password-less SSH login.
  •  After installing SSH client, you get Secure CoPy (SCP) facility which is  used to copy files to remote host.
To log in remote machine, enter following command

ssh -X user@IP_ADDRESS_OF_REMOTE_SYSTEM

In this command, use of -X Enables X11 forwarding. By using X11 forwarding, we can access GUI using file manager, else you will not be able to access GUI. Be aware of capital X, because small x stands for disable X11 forwarding which won't show you GUI.

4. Errors and Solutions

  • If you are unable to get access into server system, then check the user account name. That user account must be present at server side, because ssh won't give any error even if user account is not present on server side.
  •  " port 22: No route to host " this error occurs when wrong IP address which is not present is entered.
  • One common error is " port 22: Connection refused " this error occur if ssh service at remote system is stopped. You can overcome this by starting ssh service on the remote machine.
  •  Error " WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! " " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! "
        Cause :-  This error occurs due to change of OS at the server side or if other illegal person is using your requested server IP whose public key is known to you. Public key is stored in " known_hosts " file present in " /home/user/.ssh/ "  directory at first time when you login to server or remote machine.
        Solution :- If you want to access other machine which is not your requested  server, then you can use following command

" ssh-keygen -R IP_ADDRESS_OF_SERVER "

This command will clear or delete the entry of public key for that particular IP present in known_hosts file and create new entry and old entries are stored in " known_hosts.old "

    Read More...