Monthly Archives: October 2011

Transferring files from Windows to Linux using pscp command (PuTTY need to be installed)

we have seen most of them find it difficult to transfer files from Windows to Linux. It’s not because they don’t know how to transfer, but due to the restrictions made on the servers for installing software like Filezilla or others.

Most of the IT companies allow to install PuTTY. Using PuTTY, you can transfer files with pscp command:

PSCP Usage:

Usage: pscp [options] [user@]host:source target
      pscp [options] source

 [user@]host:target
      pscp [options] -ls user@host:filespec
Options:
  -p        preserve file attributes
  -q        quiet, don't show statistics
  -r        copy directories recursively
  -v        show verbose messages
  -P port   connect to specified port
  -pw passw login with specified password

Install PuTTY installer on your Windows system.  It will create PuTTY folder in Program Files directory in the Windows machine. Open command prompt and navigate to the folder where PuTTY has been installed(for eg: C:\Program Files\PuTTY\) and run the pscp command as shown below:

C:\>

C:\> cd “Program Files\PuTTY”

C:\Program File\PuTTY> pscp  <file-name> <destination address:/location”

Eg: C:\Program File\PuTTY> pscp c:\a.zip admin@action.test.com:/home/cpadmin

You will be prompted for the destination server password. Once you give the correct password, it will transfer the files

Advertisements

Leave a comment

Filed under Linux

Linux – (RHEL 4 or 5) : unable to login to machine, as grub is corrupt and you are in grub prompt

You have dual operating systems on your laptop: Windows 7/XP and Linux on the same machine, you choose GRUB as boot loader while installation.

Some day, you may reinstall the windows or change the partition on your machine, grub gets corrupted and you find difficulty in resolving this issue.

But the solution is to simple and you need to follow below steps:
1. Run “find /boot/grub/stage1” in grub prompt:
(Remember that for grub (hd0,1) means hda (primary controller master), second partition.)

grub> find /boot/grub/stage1

you may receive the output something like below:
hd0,7

Then run “setup (hd0,7)” and “reboot” commands

grub> setup (hd0,7)
grub> reboot

System will reboot and you will be redirected to list page.

If you want to make some changes to the boot menu, press “e” to edit you must edit the file: /boot/grub/menu.lst

A sample file on my machine:
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Linux (2.6.9-78)
root (hd0,7)
kernel /boot/vmlinuz-2.6.9-78.ELsmp ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-78.ELsmp.img
title Red Hat Linux (2.6.9-78)
root (hd0,7)
kernel /boot/vmlinuz-2.6.9-78.EL ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-78.EL.img
title Other
rootnoverify (hd0,0)
chainloader +1

It will change the page for temporarily so that you can login.
Once you login edit /boot/grub/menu.lst to change it permanently.

That should fix it.

Leave a comment

Filed under Linux