Re: Non-interactive SSH Login.
From: ColoC (colocoloc@yahoo.com)
Date: 04/25/03
- Next message: Pierre Asselin: "Re: Annoying, Remote command does not quit when ssh does"
- Previous message: Graham Wharton: "Annoying, Remote command does not quit when ssh does"
- In reply to: Alex: "Re: Non-interactive SSH Login."
- Next in thread: Darren Dunham: "Re: Non-interactive SSH Login."
- Reply: Darren Dunham: "Re: Non-interactive SSH Login."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: colocoloc@yahoo.com (ColoC) Date: 24 Apr 2003 17:24:41 -0700
"Alex" <alex.ferguson@NOSPAMdartmouth.edu> wrote in message news:<20030424111520.440f86ac.alex.ferguson@NOSPAMdartmouth.edu>...
> On 24 Apr 2003 04:48:43 -0700
> ......
>
> The authorized_keys file can contain several public keys. For example, you might have different private keys on a couple of computers and wish to log in to the ssh account from any of them. Just append each public key to authorized_keys. You don't need to keep id_rsa.pub on the remote host; sshd only looks at authorized_keys.
>
> In general sftp respects the ~/.ssh/authorized_keys file just as ssh does (because sftp is ssh under the hood). If you don't have write access to your home directory, then you will need help from your sysadmin.
>
> --Alex
Well, let's forget that ftp-only account for a while. Let's focus on
the first part -- how I can get through a non-interactive ssh login
correctly.
I did some testing on my local netwrok, and I found something that is
not good.
In my first post, I ony did the testing on the same box (via
127.0.0.1), of course, the files are all in the same directory. Now I
did it on two boxes.
First I generated rsa key on box_1. And I have the following files
under "~/.ssh/":
authorized_keys (which I "mv id_rsa.pub authorized_keys")
id_rsa
known_hosts
prng_seed
ssh_config (in which I only have "Protocol 2" open)
Then on box_2, I did "ssh myuser@box_1" to build that "~/.ssh/"
directory, and I have the following files:
prng_seed
known_hosts
Then I ftp box_1's "authorized_keys" to box_2 "~/.ssh/" directory, try
the following:
ssh -o BatchMode=yes myuser@box_1
The system prompt:
Permission denied (publickey,password,keyboard-interactive).
Then I ftp box_1's "id_rsa" to box_2 "~/.ssh/" try the following:
ssh -o BatchMode=yes myuser@box_1
suceeded in logon box_1 without password prompt. And I even tried
ssh myuser@box_1
succeeded in logon box_1 without password prompt. Then I tried
mv authorized_keys abc
ssh myuser@box_1
suceeded in logon box_1 without password prompt.
So this seems to me that it makes no difference if I have that public
key on box_2 or not, and it does not matter too much how "ssh_config"
on box_1 restricts the BatchMode=no or not, whenever I have that
"id_rsa" on box_2, I can logon.
Certainly, I know this is NOT correct for a good ssh configuration --
if you have got to have that "id_rsa", then why bother to generate its
"id_rsa.pub"? Plus "id_rsa" seems to be the very thing ssh is
meaningful in security, why do I have to share it on other boxes in
order to have a non-interactive login?
Can you help me explain the above testing results?
ColoC
- Next message: Pierre Asselin: "Re: Annoying, Remote command does not quit when ssh does"
- Previous message: Graham Wharton: "Annoying, Remote command does not quit when ssh does"
- In reply to: Alex: "Re: Non-interactive SSH Login."
- Next in thread: Darren Dunham: "Re: Non-interactive SSH Login."
- Reply: Darren Dunham: "Re: Non-interactive SSH Login."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|