My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Friday, August 31, 2012

SCP command for secure copy or transfer of files between two machines or servers.


Sometimes it is required to copy files from or to a remote server. Sometimes you may also want to copy files from one remote server to another remote server, without passing traffic through your PC. scp command line utility is a neat tool/command to securely copy files over ssh, between Linux, Mac or Windows.

It is important to note here that scp stands for secure cp (copy). It means that you can copy files across ssh connection. The connection will be securely encrypted, it is a very secure way to copy files between computers

Syntax of SCP command:

scp [[user@]from-host-addr:]source-file [[user@]to-host-addr:][destination-file]

from-host-addr
Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command
user
Is the user which have the right to access the file and directory, that is supposed to be copied in the case of the from-host, and the user who has the rights to write in the to-host
from-host-addr
Is the name or IP of the destination where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command
source-file
Is the file or files that are going to be copied to the destination host, it can be a directory but in that case you need to specify the -r option to copy the contents of the directory
destination-file
Is the name that the copied file is going to take in the to-host, if none is given all copied files are going to keep its names

There are a few options which you can explore on your own. Like –p , -q, -r (for directory) and –v etc.

My small example:
scp -r user@x.x.x.x:/anwar/jamal/faiz /destination/folder/on/present/machine
Then it asks for password for user on machine x.x.x.x.
Give that. And, see task being accompalished!!

Some quick SCP commands variation that I use are as follows:

Following is going to copy all files with .txt extension to the folder /home/user in the abc.server.com host
scp *.txt user@abc.server.com:/home/user/

Following is going to copy all file from server to ur computer
scp username@server:/home/username/file_name /home/local-username/file-name

Following is used to copy files from a remote server to another remote computer
scp user_name1@server1:/home/user_name1/file_name user_name2@server2:/home/user_name2/
In above command files are copied from one server to the other. They are not going to pass through your computer. The data flow traffic is going to pass from one server to the other directly.
:) Cheers 
Anwar Jamal faiz

Tuesday, July 24, 2012

Enable SSH Root Login Solaris 10

I was in a big trouble as I was not able to ssh to a Solaris 10 machine. More specifically, Solaris 10 was running in a VM. But that essentially, has no effect on my problem. I was not able to transfer files in my network with this newly up system, Solaris.


I was able to ping to and forth with another machine and Solaris, but SSH was not happening. No, was telnet happening. An hour of struggle led me to a good solution. And it was quite easy. You are lucky to find this solution directly! Huh..


Steps:

Open and change the file /etc/ssh/sshd_config. Find string "PermitRootLogin no" and replace "no" with "yes"

Then, restart the services as follows:
#svcadm restart ssh
#svcadm restart svc:/network/ssh:default

Now try to SSH to this machine again.
Yes, its Done!!

Tuesday, June 19, 2012

VC++: See line numbers in Visual Studio IDE

Microsoft Visual Studio, by default does not show line numbers in the Source Code editor window. Though it is much required at times, but because of some vague statistics (in my opinion :) ), Micrsoft has preferred to not make it a default option. All said, enabling it on is pretty easy. Though a lot of developer community still struggles to use Edit->Goto line number option. The steps to do this is:-

Goto Tools->options->Text editor->All languages (on some versions only  languages)->General->Display->Check the line numbers and press Apply or OK.

See the attached screenshot:


And in case you want to set this change only for one language you can select that language instead of all languages.
For eg. see below where I made changes only for VC++ coding:

Happy coding ;)
-Anwar

Friday, June 1, 2012

turn off (disable) pc speaker. Stop system beep noice- It annoys!

At times you may start getting that irritable beep sound out of you PC speakers. Once I was such annoyed that I literally banged on my CPU to stop it. And, you nothing happened! After all you need some software interrupts to start it, and other sort of interrupt to stop it.

Sometimes it really occurs so continuously that one would become ultra ultra resilient to even one instance of beep. And sometimes you execute some scripts and it keeps on making that irritable sound. Here is a quick way to put off this noice.

So basically I discovered two ways to do that.

GUI Method: Goto Device Manager->Non Plug and Play Drivers-->Beep. A window pops up. Click on Stop.


Commandline method:
And this is pretty smart and handy way to do that. The command used are net start beep and net stop beep.

This was pretty easy..Huh!
Read more often and traverse the entire list of posts to learn some seriously good tricks.
Cheers!!

Photos of Anwar Faiz with Ankit Fadia in Adobe

This post is in continuation with my old post Meeting with Ankit Fadia. Similar article is also published at My meetinng detail with Mr. Fadia on MeOnShow Forum++