sftp - Setting up Public Authentication

From: MellyGirl (melly-girl_at_verizon.net)
Date: 09/24/04


Date: Fri, 24 Sep 2004 05:11:25 GMT

I have been working on providing my group with instructions on how to write
scripts using sftp. Of course, the one thing we do not want is for the
scripts to stop due to sftp wanting a password. I know that this question
has come up several times in the newsgroup, but can someone direct me to any
sort of documentation other than man pages for doing this.

So far, I follow this pattern - sometimes I can get it work with no problems
and other times, the script will stop for a password:

System A is the source; System B is the target.

1. Using sftp manually, I connect from A to B and B to A to make sure that
each system has a key defined in the known_hosts file.
2. Using ssh-keygen -t dsa on the source system, I create a blank
passphrase. In my ~/.ssh directory, I get id_dsa and id_dsa.pub created
with the key.
3. On the target machine in ~/.ssh, I create a file called authorized_keys
(chmod 744) and put the information that is in the id_dsa.pub from the
source machine in this file. I also make sure that the information is in
one line - no line breaks.

>From this point, I create a very simple test script to upload a file

sftp -b batchfile myid@target

As I mention, sometimes, I have no problems and other times, I get prompted
for a password. If I change the script to the following:

sftp -oBatchMode=yes -b batchfile myid@target

then, I get a message indicating that it is denied and must have either a
key, password, and etc.

I have seen mentioned to turn debugging on the server machine - I do not
have "root" access, can a regular user turn the debugging on?

I apologize for asking so many newbie question, however, this is all fairly
new to me.

Thanks!



Relevant Pages

  • sftp - Setting up Public Authentication
    ... scripts to stop due to sftp wanting a password. ... I have seen mentioned to turn debugging on the server machine - I do not ... can a regular user turn the debugging on? ...
    (comp.security.ssh)
  • Re: sftp - Setting up Public Authentication
    ... >I have been working on providing my group with instructions on how to write ... >scripts to stop due to sftp wanting a password. ... Good judgement comes with experience. ...
    (comp.security.ssh)
  • which is better libssh or libssh2
    ... sftp. ... I cant use scripts due to some performance issues amongst others ...
    (comp.security.ssh)
  • Veritas and SSH
    ... I have several scripts which does SFTP between virtual hostnames. ... How can I still use SFTP between hosts when Veritas switch the active ...
    (comp.unix.solaris)
  • Veritas and SSH
    ... I have several scripts which does SFTP between virtual hostnames. ... How can I still use SFTP between hosts when Veritas switch the active ...
    (comp.security.ssh)