3 deleted 109 characters in body
source | link

I'm racking my brains here and I was hoping I could get some help. I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I wantedwant to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys file within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

Any help would be greatly appreciated.

I'm racking my brains here and I was hoping I could get some help. I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I wanted to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys file within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

Any help would be greatly appreciated.

I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I want to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys file within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

2 deleted 5 characters in body; edited title
source | link

Configured Public/Private Key on CentOS7CentOS6 - Still letting me connect without Private Key

I'm racking my brains here and I was hoping I could get some help. I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I wanted to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys directoryfile within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

Any help would be greatly appreciated.

Configured Public/Private Key on CentOS7 - Still letting me connect without Private Key

I'm racking my brains here and I was hoping I could get some help. I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I wanted to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys directory within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

Any help would be greatly appreciated.

Configured Public/Private Key on CentOS6 - Still letting me connect without Private Key

I'm racking my brains here and I was hoping I could get some help. I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I wanted to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys file within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

Any help would be greatly appreciated.

1
source | link

Configured Public/Private Key on CentOS7 - Still letting me connect without Private Key

I'm racking my brains here and I was hoping I could get some help. I have a VPS with CentOS 6. I've noticed a lot of login attempts via SSH, so I wanted to lock it down with key based authentication. Here is what I have done so far....

Ran the following on my client machine (OSX)

ssh-keygen -t rsa

Did this with default settings (no passphrase, default names, etc)

Set the following permissions on my client

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa

copied my public key to the root of my userfolder on my VPS using the following command (fake name/ip)

scp id_rsa.pub fakeuser@255.255.255.255:/home/fakeuser/id_rsa.pub

Here I noticed that I did NOT have an authorized_keys directory within my .ssh. So I used touch to create it. Then I used CAT to copy the contents of the .pub into the authorized_keys file

cat id_rsa.pub >> ~/.ssh/authorized_keys

and set the appropriate permissions on .ssh and authorized_keys

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

In /etc/ssh/sshd_config I uncommented the following

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I then restarted sshd

service sshd restart

From what I read, this is all I should have to do to enable public key authentication. However, when I attempt to SSH without supplying -i privatekey, I am allowed in from all devices.

Any help would be greatly appreciated.