mirror of
https://gitee.com/devstar/devcontainer-tweak.git
synced 2025-04-27 19:53:09 +00:00
18 lines
320 B
Bash
18 lines
320 B
Bash
#!/bin/bash
|
|
|
|
# 1. 重新生成 SSH 密钥对
|
|
rm -f /etc/ssh/ssh_host_*
|
|
ssh-keygen -A
|
|
|
|
# 2. 启动 SSH 服务
|
|
service ssh start
|
|
|
|
# 3. 默认命令检查
|
|
if [ "$#" -eq 0 ]; then
|
|
# 如果没有传入参数,则默认执行 tail -f /dev/null
|
|
exec tail -f /dev/null
|
|
else
|
|
# 执行传入的命令
|
|
exec "$@"
|
|
fi
|