how to ssh to remote unix machines using private/public key

hello,

iam able to ssh to a linux server from a linux server called "machine1" using the private/public key method, so I dont need to enter any password when I run my script but iam not able to ssh from machine1 to a UNIX server, access is denied.
note that I am using an application id which is a local id and if i run the command with my personal id (network id), it works fine.
Please let me know how to fix this problem.
Thanks

how about:

login as yourself then

su - appid

after you get logged in. It will then ask you for appid's password.

The ssh debug logs are usually good at telling you where it went wrong.

First, check out the ssh up there on the target host. Ensure you can 'ssh localhost pwd' passwordless as your id or the target id. Then, see if you can ssh between id's on the target host as localhost or its real name.

Ensure you can ssh to yourself on the starting host. Can you ssh to your id on the target host? (Hopefully, not a firewall issue!)

Then, it is just getting keys and authorized user lists straight.

did you generate the private/public key for the local app id as well (on machine1)? and did you check that the public one has been distributed on the remote machine in the ~.ssh/authorized_keys ?

s1: linux machine
s2: linux machine
s3: Unix machine

iam running a script that runs a ps command to different machines from a cron job.

when I shh from s1 to s2 --> works fine with my own id and application id
when I shh from s1 to s3 --> works fine with my own id but not with the application id

please advise, Thanks.

In case you haven't, check

man ssh-copy-id

make sure appli id exist on s1 and s3 (same uid would be better)
as appli_id@s1

ssh-keygen -t dsa

... or any other generation you like

then concatenate the content of public key
to the authorized_keys of the remote machine

appli_id@s3:~appli_id/.ssh/authorized_keys

make sur

ssh-agent 

runs fine on both s1 and s3

on s1 load your key into the agent to auto identify
then

ssh-add 

and try to connect

Make sure your ssh config if correctly setup (if necessary X11forwarding...)