Question about known_hosts - SSH

This is a discussion on Question about known_hosts - SSH ; I'm using the OpenSSH client on Red Hat Linux. Does anyone know how to set up the known_hosts file in the .ssh folder to log in to and scp into remote machines without being prompted for a password? Help much ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Question about known_hosts

  1. Question about known_hosts

    I'm using the OpenSSH client on Red Hat Linux. Does anyone know how to
    set up the known_hosts file in the .ssh folder to log in to and scp
    into remote machines without being prompted for a password?

    Help much appreciated,

    Timo Jeranko


  2. Re: Question about known_hosts

    Timo Jeranko wrote:

    > I'm using the OpenSSH client on Red Hat Linux. Does anyone know how to
    > set up the known_hosts file in the .ssh folder to log in to and scp
    > into remote machines without being prompted for a password?


    You have to copy your private key onto the remote machine, and add it
    to .ssh/authorized_keys. For example:

    on local machine do:
    ssh-keygen -t rsa
    scp ~/.ssh/id_rsa.pub user@remote:~/.ssh/my_key
    login to the remote machine, and:
    cd ~/.ssh
    cat my_key >> authorized_keys
    rm my_key

    You're done.

    PS. Some paths may vary depending on local and remote machine' OS.
    --
    Cezary Morga

  3. Re: Question about known_hosts

    In article <454b3e80@news.home.net.pl> Cezary Morga writes:
    >Timo Jeranko wrote:
    >
    >> I'm using the OpenSSH client on Red Hat Linux. Does anyone know how to
    >> set up the known_hosts file in the .ssh folder to log in to and scp
    >> into remote machines without being prompted for a password?

    >
    >You have to copy your private key onto the remote machine, and add it
    >to .ssh/authorized_keys. For example:
    >
    >on local machine do:
    >ssh-keygen -t rsa
    >scp ~/.ssh/id_rsa.pub user@remote:~/.ssh/my_key
    >login to the remote machine, and:
    >cd ~/.ssh
    >cat my_key >> authorized_keys
    >rm my_key


    Or maybe simpler:

    ssh-keygen -t rsa
    ssh user@remote 'cat >> .ssh/authorized_keys' < ~/.ssh/id_rsa.pub

    And though that wasn't what the question asked for (note "known_hosts"),
    it was probably the right answer.

    --Per Hedeland
    per@hedeland.org

  4. Re: Question about known_hosts

    /.ssh/known_hosts file is a local user database. This is used for
    server authentication.
    The client checks this file for the remote machine's entry to
    authenticate the server.
    Use Public key authenitcation for transfering files using scp. For
    this, we should copy the
    public key file to /.ssh/authorized_keys on remote machine rather than
    private key.


    Per Hedeland wrote:
    > In article <454b3e80@news.home.net.pl> Cezary Morga writes:
    > >Timo Jeranko wrote:
    > >
    > >> I'm using the OpenSSH client on Red Hat Linux. Does anyone know how to
    > >> set up the known_hosts file in the .ssh folder to log in to and scp
    > >> into remote machines without being prompted for a password?

    > >
    > >You have to copy your private key onto the remote machine, and add it
    > >to .ssh/authorized_keys. For example:
    > >
    > >on local machine do:
    > >ssh-keygen -t rsa
    > >scp ~/.ssh/id_rsa.pub user@remote:~/.ssh/my_key
    > >login to the remote machine, and:
    > >cd ~/.ssh
    > >cat my_key >> authorized_keys
    > >rm my_key

    >
    > Or maybe simpler:
    >
    > ssh-keygen -t rsa
    > ssh user@remote 'cat >> .ssh/authorized_keys' < ~/.ssh/id_rsa.pub
    >
    > And though that wasn't what the question asked for (note "known_hosts"),
    > it was probably the right answer.
    >
    > --Per Hedeland
    > per@hedeland.org



+ Reply to Thread