Compare commits

..

19 Commits

Author SHA1 Message Date
d42fccd836 debug: accept rsa keys 2023-05-04 16:08:19 +08:00
4df9913fce bug fix (Thu May 4 15:39:40 CST 2023) 2023-05-04 15:39:40 +08:00
d775ea5fe4 bug fix (Thu May 4 15:28:52 CST 2023) 2023-05-04 15:28:52 +08:00
bcf3839773 bug fix (Thu May 4 15:23:07 CST 2023) 2023-05-04 15:23:07 +08:00
017a25c3e5 bug fix (Thu May 4 15:21:15 CST 2023) 2023-05-04 15:21:15 +08:00
aba51e76b8 nameserver 2023-05-04 15:14:08 +08:00
758cedfc21 bug fix (Thu May 4 15:10:28 CST 2023) 2023-05-04 15:10:29 +08:00
af711687cd bug fix (Thu May 4 14:32:06 CST 2023) 2023-05-04 14:32:06 +08:00
c7500beee9 bug fix (Thu May 4 14:28:58 CST 2023) 2023-05-04 14:28:58 +08:00
c531b82e24 bug fix (Thu May 4 14:21:17 CST 2023) 2023-05-04 14:21:17 +08:00
9d6db4bb40 init: nasp-jumpserver 2023-05-04 14:18:10 +08:00
e28d5291c3 workable 2023-04-29 20:12:57 +08:00
xiongdian.me
b476a3e2cf try: use nvidia/cuda:11.3.1-devel-ubuntu20.04 as base image 2023-04-29 19:18:56 +08:00
xiongdian.me
c8e6646009 fix bug; init startup.sh 2023-04-29 18:45:26 +08:00
xiongdian.me
0be1013d72 try cuda 2023-04-29 18:08:43 +08:00
3dd0003bcc mlnx ofed driver ok 2023-04-29 17:44:17 +08:00
xiongdian.me
f88c3dba56 add more 2023-04-28 18:08:24 +08:00
9cf9efbdb7 now base ubuntu is ok 2023-04-28 17:45:57 +08:00
xiongdian.me
cc10132cd3 nasp-ubuntu init 2023-04-28 17:01:54 +08:00
6 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
FROM docker.io/alpine
RUN apk add --no-cache openssh git sudo tmux vim bash zsh curl wget coreutils util-linux tzdata shadow iputils \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
COPY sshd_config /etc/ssh/sshd_config
COPY ssh_config /etc/ssh/ssh_config
COPY startup.sh /etc/startup.sh
RUN cd /opt && git clone https://git.nasp.ob.ac.cn/NASP/registry \
&& ./registry/scripts/jumpserver_deploy.sh \
&& curl dotfiles.cn | bash -s - -l -u root \
&& sed -i 's?root:x:0:0:root:/root:/bin/ash?root:x:0:0:root:/root:/bin/zsh?' /etc/passwd \
&& sed -i 's?ssh:x:1000:1000:jumpserver user ssh:/home/ssh:/bin/ash?ssh:x:1000:1000:jumpserver user ssh:/home/ssh:/bin/bash?' /etc/passwd
EXPOSE 22
ENTRYPOINT ["/etc/startup.sh"]

View File

@@ -0,0 +1,2 @@
Host *
ForwardAgent yes

View File

@@ -0,0 +1,16 @@
Port 22
# Authentication:
LoginGraceTime 30s
PermitRootLogin prohibit-password
StrictModes yes
MaxAuthTries 6
MaxSessions 10
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
PasswordAuthentication no
AllowAgentForwarding yes
PubkeyAcceptedAlgorithms=+ssh-rsa
# override default of no subsystems
Subsystem sftp internal-sftp

8
nasp-jumpserver/startup.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e
echo "nameserver 192.168.16.118" > /etc/resolv.conf
test -f /etc/ssh/ssh_host_rsa_key || ssh-keygen -A
crond
/usr/sbin/sshd
bash

23
nasp-ubuntu/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM docker.io/nvidia/cuda:11.3.1-devel-ubuntu20.04
# Install dependencies
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& sed -i "s@http://.*archive.ubuntu.com@http://192.168.16.201/mirrors@g" /etc/apt/sources.list \
&& apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -yq \
-o Acquire::BrokenProxy="true" -o Acquire::http::No-Cache="true" -o Acquire::http::Pipeline-Depth="0" \
build-essential cmake openssh-server git-all sudo ssh sshpass pciutils \
python3 python3-dev python3-pip curl ca-certificates vim zsh tmux bash \
inetutils-ping less wget dialog net-tools dnsutils netcat traceroute \
cron htop zip dkms \
&& rm -rf /var/lib/apt/list/*
# mlnx ofed
RUN cd /tmp && wget http://192.168.16.118/MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu20.04-x86_64.tgz \
&& tar -xf MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu20.04-x86_64.tgz \
&& cd MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu20.04-x86_64 \
&& ./mlnxofedinstall --skip-unsupported-devices-check -q \
&& rm -rf /tmp/MLNX_OFED_LINUX-5.8-*
# startup
COPY startup.sh /etc/startup.sh
ENTRYPOINT ["/etc/startup.sh"]

5
nasp-ubuntu/startup.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -e
/etc/init.d/ssh start || echo "Failed to start sshd. Maybe the port is already in use, and please check your sshd_config. This is not an error if it's the first time you run this container."
bash