Results 1 to 8 of 8

Thread: ssh-copy-id not working on one box

  1. #1
    Join Date
    Sep 2005
    Beans
    319

    ssh-copy-id not working on one box

    I have three computers on my lan. I have installed authorized_keys entries to enable no password between two of these machines, but the third will not go there.

    The sshd_config is identical for all machines.

    Where else can I look for the trouble?

  2. #2
    Join Date
    Sep 2010
    Location
    Indian Capital City
    Beans
    916
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: ssh-copy-id not working on one box

    You may want to have a look at the id_....pub key of the base machine and see if it is actually dumped in the .ssh/authorized_keys on that remote box or not ( you can compare the entry with other machine)

    Also, do check the permission for the file and directory and compare it with other working machines
    Last edited by luvshines; October 31st, 2010 at 07:38 PM. Reason: Fixed typo
    When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Mark it [SOLVED] if the issue has been resolved

  3. #3
    Join Date
    Sep 2005
    Beans
    319

    Re: ssh-copy-id not working on one box

    Quote Originally Posted by luvshines View Post
    You may want to have a look at the id_....pub key of the base machine and see if it is actually dumped in the .ssh/authorized_keys on that remote box or not ( you can compare the entry with other machine)

    Also, do check the permission for the file and directory and compare it with other working machines
    Good suggestions. Thanks.

    The keys are there for both machines, and the permissions on all directories are the same.

    I've been doing this for years and I've never had this problem. The only change is that I upgraded all of them to 10.04 - the Best Ubuntu release ever - and I haven't felt that way since my first install.

    Perhaps my best bet - though the least interesting - is to re-install ssh on the problem box?

  4. #4
    Join Date
    Jun 2010
    Location
    Austria - Graz
    Beans
    124
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: ssh-copy-id not working on one box

    Is the no password directive active on the server when you try to copy your key to it?

  5. #5
    Join Date
    Sep 2005
    Beans
    319

    Re: ssh-copy-id not working on one box

    Quote Originally Posted by mainerror View Post
    Is the no password directive active on the server when you try to copy your key to it?

    The sshd_config is identical on all machines. Where else should I look?

  6. #6
    Join Date
    Sep 2010
    Location
    Indian Capital City
    Beans
    916
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: ssh-copy-id not working on one box

    Quote Originally Posted by holiday View Post
    The sshd_config is identical on all machines. Where else should I look?
    Try looking into ssh -vv logs. Maybe that can point to something useful. Also auth.log on the server may help
    When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Mark it [SOLVED] if the issue has been resolved

  7. #7
    Join Date
    Sep 2005
    Beans
    319

    Re: ssh-copy-id not working on one box

    Quote Originally Posted by luvshines View Post
    Try looking into ssh -vv logs. Maybe that can point to something useful. Also auth.log on the server may help
    The auth.log had it - "bad ownership or modes"

    So it was permissions, as you'd suggested at first. But! My permissions were the same for the .ssh directory on all accounts - when viewed from outside the directory. However when inside the .ssh directory and

    $ ls -la

    I noticed this

    drwxrwxrwx 38 srephen srephen 32768 2010-10-30 15:55 ..

    Whereas if I did the same from the other machines, the permissions for the .. directory were 755.

    I chmod 755 on .. and now it's working.

    That is interesting. I assume it means that I had misconfigured my home directory for universal access - some late night desperate hacking no doubt.

    Does it look like that to you, or am I missing something.

    Thanks for your help, by the way.

  8. #8
    Join Date
    Sep 2010
    Location
    Indian Capital City
    Beans
    916
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: ssh-copy-id not working on one box

    Quote Originally Posted by holiday View Post
    The auth.log had it - "bad ownership or modes"

    So it was permissions, as you'd suggested at first. But! My permissions were the same for the .ssh directory on all accounts - when viewed from outside the directory. However when inside the .ssh directory and

    $ ls -la

    I noticed this

    drwxrwxrwx 38 srephen srephen 32768 2010-10-30 15:55 ..

    Whereas if I did the same from the other machines, the permissions for the .. directory were 755.

    I chmod 755 on .. and now it's working.

    That is interesting. I assume it means that I had misconfigured my home directory for universal access - some late night desperate hacking no doubt.

    Does it look like that to you, or am I missing something.

    Thanks for your help, by the way.
    Gud to know that it is finally (re)SOLVED
    Maybe 777 for /home messed it.

    I really hate apps which fail to run due to file permissions.

    Recently someone unknowingly changed 777 perms for /etc/sudoers file and sudo stopped working
    When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Mark it [SOLVED] if the issue has been resolved

Bookmarks

Posting Permissions

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