LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 03-19-2013, 11:18 AM   #1
swaxolez
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Rep: Reputation: Disabled
How to create multiple ssh keys


I'm creating a server that will have approx. 200 users. Creating multiple users from a script is not a problem but I'm not having any success finding a way to create a ssh key pair for each user without having to login into every account and creating the pair. There has got to be an easier way to do this?

Appreciate the help.
 
Old 03-19-2013, 11:40 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,345

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
What part are you having trouble with? You can use the ssh-keygen to write to an arbitrary file and then put it where you want.

Alternatively you can easily look through all the usernames as root and run "su -u $USER ssh-keygen -f ~/.ssh/id_rsa -N ''" to create a key in their home directory with no passphrase, without human interaction
 
Old 03-19-2013, 11:51 AM   #3
swaxolez
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks acid_kewpie! I think I started searching the wrong questions late last night and somehow came to the conclusion that only the user (not even root) could create a key pair. At the end of the day I guess root really is god in linux. What you suggest is dead simple. Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH host keys are not being read correctly from .ssh/known_hosts. bartonski Linux - Software 3 10-29-2009 04:40 PM
SSH host keys VS SSH keys kenneho Linux - Security 3 09-11-2008 06:03 AM
Create multiple accounts & SSH guptawizard Linux - Newbie 2 01-13-2005 01:27 PM
Configuring SSH to accept only keys (already have keys) fr0st Linux - Security 3 11-04-2003 03:31 AM
Working with SSH and multiple private keys IgD Linux - Security 2 09-08-2003 10:07 PM


All times are GMT -5. The time now is 01:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration