# [solved] ssh login with a passphrase and not with a key

## toralf

/me just wondering how I can disable the use of a SSH key and force the passphrase while ssh'ing to a particular remote host ?Last edited by toralf on Thu Apr 04, 2013 4:04 pm; edited 1 time in total

----------

## krinn

What a strange query toralf  :Smile: 

ssh accept them thru its authorized_keys file, i suppose i would change the file owner to prevent ssh reading it to temp disable any user with a key to access it without password.

I don't know if ssh as any option for that.

----------

## ppurka

Create a ~/.ssh/config file with the following contents

```

Host <IP_Address or Hostname of remote>

    User <your user id in remote>

    PreferredAuthentications password
```

----------

## toralf

The problem is the remote host - it seems, that there the .ssh/<files> are somehow damaged :

```
debug1: Connecting to [<snip>]port 22.

debug1: Connection established.

debug1: identity file /home/tfoerste/.ssh/identity type -1

debug3: Not a RSA1 key file /home/tfoerste/.ssh/id_rsa.

debug2: key_type_from_name: unknown key type '-----BEGIN'

debug3: key_read: missing keytype

debug2: key_type_from_name: unknown key type 'Proc-Type:'

debug3: key_read: missing keytype

debug2: key_type_from_name: unknown key type 'DEK-Info:'

debug3: key_read: missing keytype

debug3: key_read: missing whitespace

...

debug3: key_read: missing whitespace

debug2: key_type_from_name: unknown key type '-----END'

debug3: key_read: missing keytype

debug1: identity file /home/tfoerste/.ssh/id_rsa type 1

debug1: identity file /home/tfoerste/.ssh/id_dsa type -1

ssh_exchange_identification: Connection closed by remote host

```

What I already tried is to remove my local .ssh directory away - but that doesn't helped - and the messages above are related to the remote files.

----------

## krinn

the id_rsa.pub (the public key part) looks like 

```
ssh-rsa ...= id@host

```

and the id_rsa (the private key part)

```
-----BEGIN RSA PRIVATE KEY-----

...

-----END RSA PRIVATE KEY-----

```

Your log shown the BEGIN and END, the user might have copied over the public key into the private key or your server offering the wrong key, i'm not quiet sure who is to blame. I would say the server close the connection, so the client is not doing the things right.

----------

## toralf

 *ppurka wrote:*   

> Create a ~/.ssh/config file with the following contents
> 
> ```
> 
> Host <IP_Address or Hostname of remote>
> ...

 good idea - doesn't work  - seems that the remote sshd is configured to not accept pass phrase ?

----------

## ppurka

Yes. could be that the remote sshd does not accept password authentication. Since all the problems are from remote, your best option is to contact the remote admin.

----------

## toralf

yep

----------

