2

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?

JuanPablo
  • 913
  • 3
  • 10
  • 21

2 Answers2

3

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.

ThorstenS
  • 3,122
  • 19
  • 21
1

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

Jeff Strunk
  • 2,127
  • 1
  • 24
  • 29