Permission denied (public key)

Discussion in 'Unix' started by TAN, Jul 27, 2020.

  1. TAN

    TAN New Member

    Joined:
    Jul 22, 2020
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Hi: I'm trying to transfer files through sftp from unix to Linux. When I run my script manually it works fine but it shows error while I configure it in the crontab. Can anyone tell me please what's wrong with it?
    upload_2020-7-27_11-41-25.png
    Thanks in advance!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,365
    Likes Received:
    385
    Trophy Points:
    83
    The only reason that one can think off is both the process are using a different key files. If you are able to perform the operations manually but not via crontan does mean the users running the process are different.

    So when they are using the public key, the manual one is authenticated but the cron one may not be authenticated on the server.
     
  3. TAN

    TAN New Member

    Joined:
    Jul 22, 2020
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I think you're correct. There are two users one is admin and the other is mrg. I've added the mgr's key to the ftp server because id_rsa.pub was found under it and not under admin. But I had to configure crontab with admin because mrg doesn't have write privilege there. Now, if I create a id_rsa.pub under admin user and configure it in the ftp server, will it work? Anything else need to be done? Please let me know!
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,365
    Likes Received:
    385
    Trophy Points:
    83
    Should work. Try it out.
     
  5. mickkimmels

    mickkimmels New Member

    Joined:
    Sep 21, 2021
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I will try the same soon!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice