mirror of
https://github.com/rorydavidson/ssh_access.git
synced 2025-01-09 05:26:51 +01:00
Updated for my own ssh magic
This commit is contained in:
parent
d4c8150e7c
commit
4421df6776
@ -6,12 +6,13 @@ To give me sudo access to a Ubuntu server.
|
||||
Run:
|
||||
|
||||
```sh
|
||||
sudo ./create_kaik_user_with_sudo_access.sh
|
||||
sudo ./create_rda_user_with_sudo_access.sh
|
||||
```
|
||||
|
||||
One liner:
|
||||
```sh
|
||||
cd /tmp && git clone https://github.com/kaicode/ssh_access.git && cd ssh_access && ./create_kaik_user_with_sudo_access.sh && echo 'Kai has access' && cd .. && rm -r ssh_access
|
||||
cd /tmp && git clone https://github.com/rorydavidson/ssh_access.git && cd ssh_access && ./create_rda_user_with_sudo_access.sh && echo 'Rory has access' && cd .. && rm -r ssh_access
|
||||
```
|
||||
<hr/>
|
||||
Thanks to [@mattwillsher](https://github.com/mattwillsher) for the idea!
|
||||
|
||||
Thanks to [@mattwillsher](https://github.com/mattwillsher) for the idea & [@kaicode](https://github.com/kaicode) for nudging me to do it!
|
||||
|
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MY_SHELL=$( which bash )
|
||||
|
||||
/usr/sbin/useradd -c 'Kai Kewley <kaikewley at gmail.com>' -s ${MY_SHELL} -m kaik
|
||||
cat >/etc/sudoers.d/kaik-ALL <<EOF
|
||||
kaik ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
EOF
|
||||
chmod 0440 /etc/sudoers.d/kaik-ALL
|
||||
mkdir ~kaik/.ssh
|
||||
chmod 700 ~kaik/.ssh
|
||||
curl https://raw.githubusercontent.com/kaicode/ssh_access/master/kaikewley_rsa.pub >~kaik/.ssh/authorized_keys
|
||||
chmod 400 ~kaik/.ssh/authorized_keys
|
||||
chown -R kaik ~kaik/.ssh
|
14
create_rda_user_with_sudo_access.sh
Executable file
14
create_rda_user_with_sudo_access.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MY_SHELL=$( which bash )
|
||||
|
||||
/usr/sbin/useradd -c 'Rory Davidson <rda at ihtsdo.org>' -s ${MY_SHELL} -m rda
|
||||
cat >/etc/sudoers.d/rda-ALL <<EOF
|
||||
kaik ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
EOF
|
||||
chmod 0440 /etc/sudoers.d/rda-ALL
|
||||
mkdir ~rda/.ssh
|
||||
chmod 700 ~rda/.ssh
|
||||
curl https://raw.githubusercontent.com/rorydavidson/ssh_access/master/rorydavidson_rsa.pub >~rda/.ssh/authorized_keys
|
||||
chmod 400 ~rda/.ssh/authorized_keys
|
||||
chown -R rda ~rda/.ssh
|
@ -1 +0,0 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTaImIf071KBu+O5lhYqJ1Agafhx7bJYVIKiarALNJQo+EZcPtIckFgm84Hu3M0ajTF2NmVtL336LVt6ohXCd8tJ40LqciqsE1jX493fDSIVTSfLOI7CM4V/p1thd6Ism2gb6jxIJ4xDGA0M8jqLgBml0HCzZxevmekIdB5qyhlNInyHsebpB2hGlyWPdF6R5c55fL70mFHfWWfWbkuVIqhJ792IslLYpapV5Xat/or7z5BfovbrfgGIAGNCcpes5ylnf28mIo66JMrJhbvkPq6L4mxxOujqtaaUjCpx+a2IVDIM3VVstTTv2x8e77or9thSPq8MrMOUChfcJ+gvyD kaikewley@gmail.com
|
1
rorydavidson_rsa.pub
Normal file
1
rorydavidson_rsa.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDoXpuxXwaPqRf883oDVZBWjoPS8RID2NDtgP03SHW2ZtAt38P0G9dgaJ5kIq3nyH42kmhrr88u2hHQnZDZdbOB+WXKWajt034TyqDEDr+vcfHihSqhniR795YsLdASulX8IVXmkC3Cee2UvwYzOCvDrqoZdlLSdhdBKQ1wwFxZdXqXEv7CLQQ74o/3y6jRXaWkEnXTNkOaL0X8kGn2uWAULbBeMH4jx6p1vjILtR9sN4cx3UFN/9YsncACgP7tbFUDN338GSZ3SjfLS3nnm7fS3NT1yfbjE67IvgKV0ubQxfhwqYnRTySAoceP1wNLRRuHXdxcvpIqEkIrufx8ANzf rda@ihtsdo.org
|
Loading…
Reference in New Issue
Block a user