Re: Is it possible to pass the password in the ssh/scp command line?

From: Bill Unruh (unruh_at_string.physics.ubc.ca)
Date: 02/22/05


Date: 22 Feb 2005 00:30:01 GMT

inn200@hotmail.com (Frank Callone) writes:

>Assume I am working on my own computer. No one else has access to it (at least for the current session).
>Now I want to use ssh. Is it possible to enter the password at the command line?

>ssh user@remotehost -p <mypassword>

Bad idea. which "remote host" is that? That suggests that you are on the
net.

Anyway, I think what y ou really want is rsa identification. On your local
computer run
ssh-keygen -t rsa
and when it asks for the name take the default, and when it asks for
password just hit return.
(Yes, this can make it dangerous if someone breaks into your machine as you
or root. On the other hand they could then install a keyboard sniffer and
get the info anyway. The main concern is if unencrypted backups are made to tape, and
someone steals the tape.)
Then do
ssh user@remotehost echo `cat .ssh/id_rsa.pub` '>>.ssh/authorized_hosts'
(this means copy the full content of the file .ssh/id_rsa.pub on your local
machine to the end of the file .ssh/authorized_hosts in the directory of
user on the remote machine)
Now you will be able to log onto user@remotehost without a password

>Or is there any other trick which prevents me from being prompted for the password?

See above.



Relevant Pages

  • Re: RMT Command
    ... Not sure how the rmt command works, but if you want to write to a tape ... drive on another system and rsh is available, here is how we ended up ... activates the dd command on the remote host and writes everything that ...
    (comp.unix.aix)
  • Re: ipcBeginProcess Error Please help. thanks!
    ... the command that I am executing is a batch file. ... And the "cdsServIpc: Command not found." ... the exact file system path on the remote host also. ...
    (comp.cad.cadence)
  • K95 2.1.3 waits on "remote host start foo"
    ... It is advertised all over the place that "start" will execute a command in the background on a Windows machine. ... as a remote host command from k95 'start' appears to not work like that. ...
    (comp.protocols.kermit.misc)
  • unattended file transfer with ssh
    ... These are notes I created for company docs. ... private key on the local host. ... $HOME/.ssh/authorized_keys on the remote host. ... On the local machine invoke this command: ...
    (comp.security.ssh)
  • Re: unattended file transfer with ssh
    ... disadvantage to using rsync and can't come up with one:) ... To set up ssh, ... $HOME/.ssh/authorized_keys on the remote host. ... On the local machine invoke this command: ...
    (comp.security.ssh)