Rails Delayed_Jobs trying to ssh into a server error: Premission Denied

I have a method in my model that uses delayed_jobs and it is supposed to ssh into a server and delete files but I keep getting Permission denied, please try again. in my log when I see delayed_job trying to complete the task.

The following below works without putting it in delayed_jobs. It seems as if delayed_jobs is like its own user and I need to add it to my server to be able to ssh into it. I did adduser delayed_job that did not work, I tried adduser DJ that as well did not work. Keep getting the same errors as above. What would be a solution to this issue I am facing?

for testing purposes I am trying the following below

before_destroy :schedule_destroy

def schedule_destroy
  User.delay(run_at: 1.minutes.from_now).destroy_numbers
end

def self.destroy_numbers
 SysExecLogger.exec "ssh myserver 'rm -r /var/gluster/recordings/boop/'"
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs