# Can't ssh as ordinary user, can ssh as root

## Carnildo

When I try to SSH from one of my computers to any other while logged in as an ordinary user, I can't:

```
$ ssh mark@wolf

Host key verification failed.

$ ssh root@router

Permission denied (publickey,keyboard-interactive).

$ ssh remote@my.companys.server.com

Host key verification failed.

```

But doing so as root works just fine:

```
# ssh mark@wolf

Password:

# ssh root@router

Password:

# ssh remote@my.companys.server.com

Password:

```

Any ideas?

----------

## krinn

you have changed your user ssh key (but not your root ssh key), so the hosts recognize your user, check its key, and as it change, deny/fail.

-> restore original key in ~/.ssh 

or

-> revoque the old key on affected computers from known_hosts and add the new one in authorized_keys

ie as root

#cd /home/(your users that fail/.ssh

#scp id_rsa.pub wolf:/home/mark/.ssh/mynewkey (bad idea to not change its name while copying it :p )

#ssh wolf

wolf# cd /home/mark/.ssh

wolf# cat mynewkey >> authorized_keys

wolf# rm mynewkey && rm known_hosts

----------

## Carnildo

With the exception of the computer I'm sshing from, none of the computers involved is using keys for user authentication -- they all use passwords.  Was there some change made to ssh recently that causes it to always try using keys if it can find them in ~/.ssh?

Update: I removed ~/.ssh/known_hosts on the computer I'm sshing from, and now I get "Host key verification failed" for every computer I try to ssh to.

----------

## tuber

The remote hosts that give you the error, are they listed in /etc/ssh/ssh_known_hosts?

----------

## Carnildo

No such file exists.

----------

## didl

Could you please try ssh -v -v so we get a bit more debugging info.

----------

## Carnildo

I've found the problem:

```
$ ssh -v -v wolf

...snip assorted output...

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug2: no key of type 0 for host wolf

debug2: no key of type 2 for host wolf

debug1: read_passphrase: can't open /dev/tty: Permission denied

Host key verification failed.

$ ls -l /dev/tty

crw-rw---- 1 root tty 5, 0 2004-04-12 15:15 /dev/tty

$ groups

users wheel cron games webeditors portage exec

```

Looks like more fallout from the power failure last week.  I thought I'd fixed all the problems in /dev, but apparently not.

----------

