Skip to main content

raspberry pi Raspberry Pi passwordless sshSSH - refusing key

I'm following this tutorial:    http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key Pi -Authentication SSH Public Key Authentication

 , but I'm generating the keys directly on my raspberryRaspberry. 

So this is exactly what I did:

start a fresh raspibianRaspbian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pubid_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keysauthorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry piRaspberry Pi. It asks me to type the usseruser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methosmethods available (server sent: public key)

I've already formatedformatted my piPi 3 times and tried this with a fresh installation, but I'm getting these errors.

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key). When I see the permissions of the file "id_rsa.pub"id_rsa.pub inside authorized_keysauthorized_keys I get:

-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alright?

Update 2:

It looks like that authorized_keysauthorized_keys is a file not a directory. So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keysauthorized_keys must be owned by pipi, also?

UPDATE 3:

Changed group and user to pipi and it worked. Thank you all.

raspberry pi passwordless ssh refusing key

I'm following this tutorial:  http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

  but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these errors.

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key). When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:

-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alright?

Update 2:

It looks like that authorized_keys is a file not a directory. So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

Raspberry Pi passwordless SSH - refusing key

I'm following this tutorial:  Raspberry Pi - SSH Public Key Authentication, but I'm generating the keys directly on my Raspberry. 

So this is exactly what I did:

start a fresh Raspbian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my Raspberry Pi. It asks me to type the user I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methods available (server sent: public key)

I've already formatted my Pi 3 times and tried this with a fresh installation, but I'm getting these errors.

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key). When I see the permissions of the file id_rsa.pub inside authorized_keys I get:

-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alright?

Update 2:

It looks like that authorized_keys is a file not a directory. So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

copy editing
Source Link
Ghanima
  • 15.9k
  • 16
  • 63
  • 120

I'm following this tutorial: http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these erros :(errors.

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key). When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key).
When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:
-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub
 
is everything alrigth?


Update 2:

It looks like that authorized_keys is a filem not a directory. 

Sois everything alright?

Update 2:

It looks like that authorized_keys is a file not a directory. So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

I'm following this tutorial: http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these erros :(

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key).
When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:
-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub
 
is everything alrigth?


Update 2:

It looks like that authorized_keys is a filem not a directory. 

So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

I'm following this tutorial: http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these errors.

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key). When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:

-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alright?

Update 2:

It looks like that authorized_keys is a file not a directory. So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

added 75 characters in body
Source Link
magro
  • 3
  • 1
  • 3

I'm following this tutorial: http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these erros :(

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key).
When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:
-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alrigth?


Update 2:

It looks like that authorized_keys is a filem not a directory. 

So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

I'm following this tutorial: http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these erros :(

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key).
When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:
-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alrigth?


Update 2:

It looks like that authorized_keys is a filem not a directory. 

So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

I'm following this tutorial: http://www.codeproject.com/Tips/600050/Raspberry-Pi-SSH-Public-Key-Authentication

but I'm generating the keys directly on my raspberry. So this is exactly what I did:

start a fresh raspibian image

ssh-keygen -t rsa -C "my_name"

Saved at default folder /home/pi/.ssh

Copied the public key id_rsa.pub to /home/pi/.ssh/authorized_keys using the command:

cd /home/pi/.ssh
mkdir authorized_keys
cp id_rsa.pub authorized_keys/

so then I've gone to authorized_keys with

cp authorized_keys

and there was my public key in the format

ssh-rsa big_string_here my_name

then I copied the private key to my pen drive using

cp id_rsa /media/PENDRIVE

Opened puttygen, gone to Conversions, imported the key from my pen drive, saved the private key also in my pen drive, then opened Putty and started a connection to my raspberry pi. It asks me to type the usser I want to connect, I type pi and then the terminal writes this:

"server refused our key"

And gives the error:

Disconnected: No supported authentication methos available (server sent: public key)

I've already formated my pi 3 times and tried this with a fresh installation, but I'm getting these erros :(

Could someone help me?

UPDATE:

When I try to log from the same raspberry pi, it says: Permission denied (public key).
When I see the permissions of the file "id_rsa.pub" inside authorized_keys I get:
-rw-r--r-- 1 root root 387 Fevb 16 14:06 id_rsa.pub

is everything alrigth?


Update 2:

It looks like that authorized_keys is a filem not a directory. 

So I changed it to a file and now there are the permissions:

-rw------- 1 root root 387 Apr 25 18:44 authorized_keys
-rw------- 1 pi pi 1766 ... id_rsa
-rw-r--r-- 1 root root 387 ... ida_rsa.pub

I think authorized_keys must be owned by pi, also?

UPDATE 3:

Changed group and user to pi and it worked. Thank you all.

added 373 characters in body
Source Link
magro
  • 3
  • 1
  • 3
Loading
added 293 characters in body
Source Link
magro
  • 3
  • 1
  • 3
Loading
Source Link
magro
  • 3
  • 1
  • 3
Loading