add user script
This commit is contained in:
parent
5bd314c68c
commit
5f30b31ec9
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
grep jenkins /etc/group >/dev/null 2>&1 || sroupadd jenkin
|
||||||
|
grep jenkins /etc/passwd >/dev/null 2>&1 || useradd jenkins -g jenkins -G docker -m
|
||||||
|
|
||||||
|
[[ ! -d '/home/jenkins/.ssh' ]] && mkdir /home/jenkins/.ssh
|
||||||
|
|
||||||
|
grep 'jenkins@localhost.thelinuxpro.net' >/dev/null 2>&1 || echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDZzcq/InUD3bbrVC+7HzIjhaiz8Nc21ZO1Wu6OsVijs jenkins@localhost.thelinuxpro.net' >> /home/jenkins/.ssh/authorized_keys
|
||||||
|
|
||||||
|
chown -R jenkins.jenkins /home/jenkins/.ssh
|
||||||
|
chmod -R 0700 /home/jenkins/.ssh
|
||||||
|
|
||||||
|
usermod -a -G docker kkenny
|
||||||
|
|
Loading…
Reference in New Issue