Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
SSH Keys and moving to user access computer
View previous topic :: View next topic  
Author Message
lkraemer
Member


Joined: 25 Jun 2010
Posts: 37

PostPosted: Thu May 12, 2011 11:13 pm    Post subject: SSH Keys and moving to user access computer Reply with quote

I have the files for the SSH keys that SMS generated when it initially
booted up on my USB Flash Drive.

Where do I copy these files on my laptop so I can ssh into my sms server
and have access? I've been searching on the internet and typically the key
is generated by the user and placed on the server. so, this is a bit
foreign to me.

Thanks.

Larry
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1753
Location: Greece

PostPosted: Fri May 13, 2011 5:45 am    Post subject: Reply with quote

You can always ssh to your machine with password, if you want to automatically login with no password using your ssh key, run
Code:
ssh-keygen -t rsa
and type a password or press enter
it will create
Code:
~/.ssh/id_rsa
~/.ssh/id_rsa.pub

Copy your public key and assign permissions
Code:
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

Move your ssh keys to client and place them at
~/.ssh folder, or use like
Code:
ssh -i id-rsa.pub root@yourserver

the first time you will login it will ask you to accept the certificate just type "yes"

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
lkraemer
Member


Joined: 25 Jun 2010
Posts: 37

PostPosted: Fri May 13, 2011 3:47 pm    Post subject: Reply with quote

OK, I still need more clarification......

I can ssh into my SMS Server with my Server password.......but I want to
login with no password using ssh keys......and I am thinking I want to use
the ones that SMS created on Initial install & bootup. Is that reasonable?
I understand that SMS created several Private and Public keys. in fact it created 8 files that I have copied to my Linux Debian Laptop to my
/home/larry/.ssh/ subdirectory.

So, from this point how do I get those keys to be accepted when I
login to the SMS Server? I need specifics, please.....

If I need to create another set of keys, do I do it on the SMS Server,
or my Laptop? Or, does it make a difference?

Would this be the correct procedure for doing it on the SMS Server?

You can always ssh to your SMS Server from your Laptop using your SMS Servers password, or if you want to automatically login to the SMS Server with no password, and by using your ssh key, run the following on your
SMS Server:
Code:

ssh-keygen -t rsa

and type a password or press enter, it will create Private & Public Keys for
rsa.
Code:

~/.ssh/id_rsa
~/.ssh/id_rsa.pub

Copy your public key from the SMS Server to authorized_keys and assign permissions
Code:

cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

Move your ssh Public keys to the client (Laptop) and place them at
~/.ssh folder, or use something like
Code:

ssh -i id-rsa.pub root@yourserver

the first time you will login it will ask you to accept the certificate just type "yes"

Should the authorized_keys file be for Version 1 or Version 2? Or should I create both?

Thanks.

Larry
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1753
Location: Greece

PostPosted: Fri May 13, 2011 6:13 pm    Post subject: Reply with quote

The random keys are generated, because they don't exist,
just copy your keys you created with 'ssh-keygen' in your home
/home/larry/.ssh/
and if you have already an authorized_keys, do
Code:
cat /home/larry/.ssh/id_rsa.pub >> /home/larry/.ssh/authorized_keys
chmod -R 600 /home/larry/.ssh/

that's it and ssh like
"ssh root@yoursmsserver"

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
lkraemer
Member


Joined: 25 Jun 2010
Posts: 37

PostPosted: Sat May 14, 2011 4:53 pm    Post subject: HOWTO: ssh keys Reply with quote

Here is a text document of the exact procedures I used to generate my
ssh keys for my SMS Server, along with information on setting up my Laptops.

Maybe you want to edit/cleanup/modify as necessary to make a HOWTO:
to post in that section.

Hopefully it will save someone several hours of trouble.

THANKS.

Larry



ssh_Settings.zip
 Description:
HOWTO: Install your ssh keys on the SMS Server & Laptops.

Download
 Filename:  ssh_Settings.zip
 Filesize:  851 Bytes
 Downloaded:  690 Time(s)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional