Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Posts
    268

    Please help with this ssh error!

    Hi guys,

    I was trying to generate ssh key for my server and get this message below
    Code:
    [andyj@server ~]$ ssh-keygen -t dsa
    Generating public/private dsa key pair.
    Enter file in which to save the key (/home/andyj/.ssh/id_dsa): [Enter] 
    Enter passphrase (empty for no passphrase): [Enter] 
    Enter same passphrase again: [Enter]
    open /home/andyj/.ssh/id_dsa failed: Permission denied.
    Saving the key failed: /home/andyj/.ssh/id_dsa.
    andyj: this is my username for my domain which is hosted in that server.
    How do i allow 'andyj' user to have permission to do this ? Note, I can do this with 'root' just fine. I'm using CentOS 5. Thanks

  2. #2
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Your user doesn't have permission to write to that directory.
    Code:
    ls -la /home/andyj/.ssh
    I believe it's usually user:user 700.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  3. #3
    Join Date
    Jan 2005
    Posts
    268
    Quote Originally Posted by foobic View Post
    Your user doesn't have permission to write to that directory.
    Code:
    ls -la /home/andyj/.ssh
    I believe it's usually user:user 700.
    Thanks but what do you mean by 'user:user 700' ? sorry i am new to this. YEs, i believe user 'andyj' doesn't have permission to write this file. Can we change this ? if yes, how do i do that ? thanks

  4. #4
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Show current ownership and permissions:
    Code:
    ls -la /home/andyj/.ssh
    Change ownership, if necessary (as root):
    Code:
    chown andyj:andyj /home/andyj/.ssh
    Change permissions, if necessary:
    Code:
    chmod 700 /home/andyj/.ssh
    You may also have problems with the permissions on the parent directory /home/andyj.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  5. #5
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    Make sure the following permissions are set.

    file authorized_keys 600
    folder .ssh 700
    Home Directory 711
    Keys (id_dsa,id_rsa) 600
    Public Keys (id_dsa.pub,id_rsa.pub) 644
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  6. #6
    Join Date
    Jan 2005
    Posts
    268
    Quote Originally Posted by foobic View Post
    Show current ownership and permissions:
    Code:
    ls -la /home/andyj/.ssh
    Change ownership, if necessary (as root):
    Code:
    chown andyj:andyj /home/andyj/.ssh
    Change permissions, if necessary:
    Code:
    chmod 700 /home/andyj/.ssh
    You may also have problems with the permissions on the parent directory /home/andyj.
    Thanks, it works now. The problem was the permission of .ssh folder.

Posting Permissions

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