Compare commits

...

10 Commits

Author SHA1 Message Date
0cfb4bc2be key: dictxiong/pc1 2023-05-04 16:12:16 +08:00
930deb1349 debug 2023-05-04 15:10:48 +08:00
xiongdian.me
891d6cd73f file nasp mod -x 2023-04-28 16:43:41 +08:00
xiongdian.me
bbc8d97422 sudo /usr/sbin/shutdown 2023-04-28 16:42:01 +08:00
xiongdian.me
746d326356 sudo /usr/bin/nvidia-smi 2023-04-28 16:41:20 +08:00
4026106afb init README.md 2023-04-24 21:20:12 +08:00
xiongdian.me
5965fc742f key: dictxiong/ltp1-bd 2023-04-23 16:03:56 +08:00
a11b2b60c7 jumpserver use /etc/crontabs/root instead of /etc/crontab 2023-04-21 17:56:16 +08:00
179eac4dc6 bug fix (Fri Apr 21 17:36:00 CST 2023) 2023-04-21 17:36:01 +08:00
f7fa5afce2 try: adding a new key pc1 2023-04-21 17:27:48 +08:00
6 changed files with 10 additions and 3 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# The NASP Cluster Registry

View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKhS4voo3K/Dvzqckr0bouO1WkCI5XxswstHWnuuyKBz ltp1-bd

View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHLYgVj+NPino6sOmahULN7SbAMaVAgzqPfDjz2S8zDv pc1

View File

@ -8,6 +8,8 @@ adduser \
--gecos "jumpserver user ssh" \
ssh
usermod -p '*' ssh
insert_if_not_exist()
{
filename=$1
@ -18,6 +20,6 @@ insert_if_not_exist()
grep -qxF -- "$line" "$filename" || echo "$line" >> "$filename"
}
insert_if_not_exist "/etc/crontab" "*/5 * * * * cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/jumpserver_cron.sh"
insert_if_not_exist "/etc/crontabs/root" "*/5 * * * * cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/jumpserver_cron.sh"
"$THIS_DIR"/jumpserver_cron.sh

3
scripts/nasp Executable file → Normal file
View File

@ -1,4 +1,5 @@
%nasp ALL = (root) NOPASSWD: /usr/bin/docker
%nasp ALL = (root) NOPASSWD: /usr/sbin/reboot
%nasp ALL = (root) NOPASSWD: /usr/bin/whoami
%nasp ALL = (root) NOPASSWD: /usr/bin/nvidia-smi
%nasp ALL = (root) NOPASSWD: /usr/sbin/shutdown

View File

@ -15,6 +15,6 @@ insert_if_not_exist()
grep -qxF -- "$line" "$filename" || echo "$line" >> "$filename"
}
insert_if_not_exist "/etc/crontab" "*/5 * * * * cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/testbed_cron.sh"
insert_if_not_exist "/etc/crontab" "*/5 * * * * root cd \"$THIS_DIR\" && git pull && \"$THIS_DIR\"/testbed_cron.sh"
"$THIS_DIR"/testbed_cron.sh