Find the answer to your Linux question:
Results 1 to 5 of 5
I have set up public key in the server system and trying to run scp command without password but its not working and still asking for password.This is the command: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    6

    Scp command without password not working


    I have set up public key in the server system and trying to run scp command without password but its not working and still asking for password.This is the command:

    scp -v bvtscript balraj@172.23.177.xxx:/home/balraj


    Can you please let me know why its not working?Also if its possible to pass password for the scp command somehow let me know.As this command i am using inside a script.

    Regards,
    Raj

  2. #2
    Linux User
    Join Date
    Aug 2006
    Location
    Croydon, PA
    Posts
    392
    A couple of question.
    1. What user were you when you created the key?
    2. Where did you put the public key on the client?
    3. What was the name of the public file on the client?
    4. What is the "xxx" on this 172.23.177.xxx?
    5. What type of server is the above? Unix ( what flavor, Sun, AIX, HP), Linux, Windows?
    6. Can you ssh to client with out it asking for the password?
    Good Luck,
    Ski
    RHCT

  3. #3
    Just Joined!
    Join Date
    Feb 2007
    Posts
    6

    Scp command without password not working

    Quote Originally Posted by Skiboy
    A couple of question.
    1. What user were you when you created the key?
    same user who is doing the scp like cherry
    2. Where did you put the public key on the client?
    if you mean by client the system from where executing the scp command then public key is generated by keygen command and id_rsa.pub is the public key.
    3. What was the name of the public file on the client?
    id_rsa.pub
    4. What is the "xxx" on this 172.23.177.xxx?
    xxx is 123
    5. What type of server is the above? Unix ( what flavor, Sun, AIX, HP), Linux, Windows?
    Linux -Red Hat
    6. Can you ssh to client with out it asking for the password?
    no i cannot ssh without asking for the password.

  4. #4
    Linux User
    Join Date
    Aug 2006
    Location
    Croydon, PA
    Posts
    392
    Ok I got to get to work but I'll try to give you some help.

    1. What user were you when you created the key?
    same user who is doing the scp like cherry
    Ok
    2. Where did you put the public key on the client?
    if you mean by client the system from where executing the scp command then public key is generated by keygen command and id_rsa.pub is the public key.
    Wrong. the id_rsa.pub needs to be in the /home/cherry/.ssh directory AND the file name MUST be changed to authorized_keys. The permissions of the .ssh directory are very strict and need to be set to 700 and the authorized_keys set to 644.
    3. What was the name of the public file on the client?
    id_rsa.pub
    Like I said it is authorized_keys in /home/cherry/.ssh
    4. What is the "xxx" on this 172.23.177.xxx?
    xxx is 123
    Still has me confused I don't understand. is this IP6
    5. What type of server is the above? Unix ( what flavor, Sun, AIX, HP), Linux, Windows?
    Linux -Red Hat
    Good
    6. Can you ssh to client with out it asking for the password?



    Remember do a regular scp from the server to the client and put in password and copy the id_rsa.pub as authorized_keys.
    scp ./id_rsa.pub 172.23.177:/home/cherry/.ssh/authorized_keys

    Once this is done exit out and try againwith yor original file scp.
    Good Luck,
    Ski
    RHCT

  5. #5
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    3. What was the name of the public file on the client?
    id_rsa.pub
    The public key should be on the sshd server side, as specified earlier in the thread.

    The private key should be on the client side -- e.g.
    ~/.ssh/id_rsa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •