From Lina's column this week
http://www.linuxcare.com/viewpoints/lina/04-24-00.epl

Dear Lina:

I am currently helping my father set up a Linux system. He lives in another 
state, so I'm
planning to implement ssh and administer his machine remotely.

I have had great success getting ssh to work, but for some reason I can't 
get scp to work.
Every time I try to copy something using scp I get a "command not found" 
error. I have done
verbose output of the command and the remote site is not finding the scp 
command to
establish the connection.

How can I verify if this is the problem and if so, how can I fix it?

Exposed in Eugene

Dear Exposed:

Using Secure SHell (ssh) and Secure CoPy (scp) are good ways to maintain 
your system
security. As you may know, love, ssh is a secure replacement for telnet/rsh 
and scp is a
secure replacement for ftp/rcp. Instead of sending passwords over the 
network in plaintext,
ssh sets up an encrypted "tunnel". This way, anyone sniffing the network 
will be unable to
see the data being exchanged.

It sounds like you have a pretty good diagnosis of the problem already. 
 From what you've
described, I'd say the server you are trying to copy a file to has ssh but 
lacks scp.

If you have root access to the remote machine, use the command whereis scp. 
You should
get output similar to the following:

scp: /usr/bin/scp /usr/man/man1/scp.1

This shows that scp exists and is in one of the standard paths. If this 
file doesn't exist on the
remote end or is in the wrong path, scp will not work. The simple fix is to 
reinstall scp.

Also, be sure you are invoking scp with the correct syntax, dear! The man 
page can be a bit
confusing. Here are two examples of scp syntax:

% scp file_to_transfer.txt remote.machine.com:public_html

% scp remote.machine.com:file_to_transfer.txt .

In the first example, I am copying the file from the current directory on 
the local machine to
the public_html directory on the remote machine. In the second example, I 
am copying
file_to_transfer.txt from the default directory on the remote machine to 
the current working
directory on the local machine.

Other problems I commonly see with ssh/scp usually involve the 
incompatibilities between
ssh version 1.x and version 2.x. ssh2 was completely redesigned, and 
unfortunately, it has a
lot of problems with backward compatibility. Additionally, ssh2 has a much 
stricter licensing
agreement. Check www.ssh.com for exact details.

These conditions are intolerable for Lina, hon! I don't put up with any of 
that; I just use
OpenSSH. OpenSSH was developed by the friendly OpenBSD folks as a 
completely free
replacement for ssh. It has been ported over to Linux, and like all OpenBSD 
software, it has
been audited for security holes. I highly recommend it!

Remotely,
Lina

Reply via email to