Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If it is just the password that the shell is asking for, then you may be able to produce an identity file (read only by you or rather the cron job owner) and use the "-i identityfile" option. Another method is to use an ~/ssh/authorized_hosts file. The ssh manpage also mentions using a type of DNS record to establish identity. I'm not familiar with this option myself.
If you use an authorized_hosts file, and maybe even the first method, you may need to regenerate the keys on the target host machine and make sure to hit enter when it asks for the passphrase. This was the reason for asking about whether this was just the password, and not the passphrase that you are entering.
...in addition to that you can also link an authorized key with a command to run: see man sshd under command="command". And if you're gonna cronjob it anyway, why not do so on the host itself?
I am trying to run a command from a local host onto a remote host server.
This is what I have done:
-------------------------------------------------------------------------
Local Host (accci): user accadm:
/home/accadm:> ssh-keygen -t dsa (enter & enter and created a file)
The first thing that caught my eye is that you are making your authorized_keys file world readable. On other configuration files, this will make ssh refuse to connect even with a password. I would try at least removing the read bit for "others".
Look in the /etc/ssh_config and /etc/sshd_config files for options that could effect authentication. Options like StrictModes and UsePAM may effect how authentication is handled. StrictModes may even cause ssh to look how the permissions on your home directory is set up. If, for example, your home directory's group ownership is "users" and the group read bit isn't cleared for the ~/.ssh/ directory, anyone ( who is a member of the users group ) can read files in your home directory, and ssh may assume your home directory is insecure.
The /etc/sshd_config file also may contain an option that could change the location of a users authorized_keys file.
I'm not versed enough in PAM or the configuration options of sshd to say any more. The permission settings is the only thing I noticed from your response that might be wrong.
Looking in /etc/pam.d/sshd may be illustrative. ( Or it may make your eyes glaze over, like it did mine. ).
References:
man 5 ssh_config
man 5 sshd_config
man pam_ssh
I hate it when I try to help another user, and end up being more confused myself!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.