Quote:
Originally Posted by coaxfiber
I'm currently login in unix not in Windows.
The link I posted http://sial.org/howto/openssh/publickey-auth/ is really much more oriented to unix/linux than windows, so that should be fine
Quote:
Originally Posted by coaxfiber
I tried to use RSA/DSA , I followed the procedures on how to do it, but still not working.
I have tested those procedures myself and they worked fine for me. We'll need more details.
Quote:
Originally Posted by coaxfiber
this works good. but my problem now is that limited command runs on ftp. not all unix command works on ftp. FYI.
That's right. ftp is NOT INTENDED to be a login shell. It's intended for file transfer, not for general use.
Quote:
Originally Posted by coaxfiber
So I'm still thinking that I can to this using TELNET.
Personally, I always discourage using TELNET for almost anything. SSH is much better. Security is important and telnet's security is lousy. SSH is far preferable. One of the first things I always do when I set up a unix or linux box is to disable telnet and ftp. (Use sftp or scp instead.)
From your next post:
Quote:
Originally Posted by coaxfiber
Hi, this is what i got..
What you got *how*?
Quote:
Originally Posted by coaxfiber
You can get a public key's fingerprint by running
% ssh-keygen -F publickey.pub
on the keyfile.
That's not right at all. Check the man page for ssh-keygen. The -F switch is to
Quote:
Originally Posted by man ssh-keygen
Search for the specified hostname in a known_hosts file, listing any occurrences found. This option is useful to find hashed host names or addresses and may also be used in conjunction with the -H option to print found keys in a hashed format.
The -l (lowercase L) switch is for showing a fingerprint. For example:
- $ ssh-keygen -l
-
Enter file in which the key is (/home/prn/.ssh/id_rsa):
-
2048 76:2a:13:20:98:36:5f:5f:ea:9a:46:36:13:22:af:b4 /home/prn/.ssh/id_rsa.pub
Quote:
Originally Posted by coaxfiber
i dunno why is it .ssh2 ? what's the difference between .ssh and .ssh2?
Interesting question, but even more relevant is the question of what you did to generate this output.
I'd suggest wiping out everything in .ssh2 and probably most of what's in the .ssh directory of both your login machine and the one you want to connect to. Then start over following the directions for how to generate the keys. Note that the reference page says "Do not use your account password, nor an empty passphrase", but if I understand correctly that you want to run the script when you are not logged in, you would not be able to use the ssh-agent solution and you would need to generate the key with no passphrase, i.e., an empty passphrase, so just hit enter. Otherwise, follow the instructions right through the part about "key distribution". You should then be able to ssh from your account on the "current" computer to your account on the "other" server without being asked for a password.
Once you can do that, you can run any command or script you want on the "other" server. In particular, you can run commands that are not part of the limited repertoire of FTP.
Of course, what you actually
said you were going to do was run "ls -al" "continuously". I hope you mean that you are going to run it "at intervals" rather than all the time. I presume this means you are polling for some condition on the remote machine and then you plan to do something with the result, but what you plan to do with the result is completely unclear and I do have to wonder if I am just giving you the ammunition to shoot yourself in the foot. Please do try not to run anything "continuously". Your sysadmin will not thank me for enabling you if you do. Please be considerate of your sysadmin and of other users and not tie up resources on the remote host unnecessarily. If you have to poll the other machine, do it at reasonable intervals and then do whatever you must.
Also, instead of running a script on your local machine that polls the other machine, perhaps it would be a better idea to run a script on the remote machine that polls for the relevant condition and then either does what must be done or notifies your local machine. Have you thought of that? You can set up a cron job on the remote host and then have it do what must be done there.
If both your "local" and "remote" hosts need to be involved, then perhaps the remote host should poll for the file and then scp it to your local box. There are always many ways to organize such tasks. The more I think about what little you have told us so far, the less confident I am that I understand what you are doing.
Paul