Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In linux, If I added a file or a directory in /etc/skel, when I create a user this get the file or dir in skel.

with

ssh-keygen -t rsa 

I can create the ssh keys

how I can automatically create the ssh keys each time when I added a user?

share|improve this question
    
mmm a problem is : how the user set the passphrase? –  JuanPablo Apr 19 '12 at 23:03
add comment

2 Answers

man adduser under debian:

If the file /usr/local/sbin/adduser.local exists, it will be executed after the user account has been set up in order to do any local setup.

share|improve this answer
add comment

You should write a wrapper script around useradd that runs ssh-keygen and anything else you need when you create an account.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.