mirror of
https://github.com/rancher/os.git
synced 2025-08-25 17:59:17 +00:00
Add missing commits from os-images
This commit is contained in:
parent
afcb0d38fe
commit
bbf33a771e
@ -5,15 +5,19 @@ setup_ssh()
|
|||||||
{
|
{
|
||||||
for i in rsa dsa ecdsa ed25519; do
|
for i in rsa dsa ecdsa ed25519; do
|
||||||
local output=/etc/ssh/ssh_host_${i}_key
|
local output=/etc/ssh/ssh_host_${i}_key
|
||||||
if [ ! -e $output ]; then
|
if [ ! -s $output ]; then
|
||||||
local saved="$(ros config get rancher.ssh.keys.${i})"
|
local saved="$(ros config get rancher.ssh.keys.${i})"
|
||||||
local pub="$(ros config get rancher.ssh.keys.${i}-pub)"
|
local pub="$(ros config get rancher.ssh.keys.${i}-pub)"
|
||||||
|
|
||||||
if [[ -n "$saved" && -n "$pub" ]]; then
|
if [[ -n "$saved" && -n "$pub" ]]; then
|
||||||
(
|
(
|
||||||
umask 477
|
umask 077
|
||||||
echo "$saved" > ${output}
|
temp_file=$(mktemp)
|
||||||
echo "$pub" > ${output}.pub
|
echo "$saved" > ${temp_file}
|
||||||
|
mv ${temp_file} ${output}
|
||||||
|
temp_file=$(mktemp)
|
||||||
|
echo "$pub" > ${temp_file}
|
||||||
|
mv ${temp_file} ${output}.pub
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
ssh-keygen -f $output -N '' -t $i
|
ssh-keygen -f $output -N '' -t $i
|
||||||
@ -76,7 +80,7 @@ cat > /etc/respawn.conf << EOF
|
|||||||
/usr/sbin/sshd -D
|
/usr/sbin/sshd -D
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
for i in ttyS{0..4} tty0 ttyAMA0; do
|
for i in ttyS{0..4} ttyAMA0; do
|
||||||
if grep -q 'console='$i /proc/cmdline; then
|
if grep -q 'console='$i /proc/cmdline; then
|
||||||
echo '/sbin/getty 115200' $i >> /etc/respawn.conf
|
echo '/sbin/getty 115200' $i >> /etc/respawn.conf
|
||||||
fi
|
fi
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM rancher/os-centosconsole-base
|
FROM rancher/os-centosconsole-base
|
||||||
# FROM amd64=centos:7 arm64=skip arm=armhfbuild/centos:7
|
# FROM amd64=centos:7 arm64=skip arm=armhfbuild/centos:7
|
||||||
RUN yum upgrade -y && \
|
RUN yum upgrade -y && \
|
||||||
yum install -y iptables openssh-server rsync sudo vim less ca-certificates psmisc htop
|
yum install -y iptables openssh-server rsync sudo vim less ca-certificates psmisc htop procps-ng
|
||||||
RUN rm -rf /etc/ssh/*key*
|
RUN rm -rf /etc/ssh/*key*
|
||||||
RUN rm -fr /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
RUN rm -fr /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
||||||
RUN ln -s /sbin/agetty /sbin/getty
|
RUN ln -s /sbin/agetty /sbin/getty
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM rancher/os-fedoraconsole-base
|
FROM rancher/os-fedoraconsole-base
|
||||||
# FROM amd64=fedora:23 arm64=rancher/aarch64-fedora:23 arm=armv7/armhf-fedora:23
|
# FROM amd64=fedora:23 arm64=rancher/aarch64-fedora:23 arm=armv7/armhf-fedora:23
|
||||||
RUN dnf upgrade -y && \
|
RUN dnf upgrade -y && \
|
||||||
dnf install -y iptables openssh-server rsync sudo vim less ca-certificates psmisc htop
|
dnf install -y iptables openssh-server rsync sudo vim less ca-certificates psmisc htop procps-ng
|
||||||
RUN rm -rf /etc/ssh/*key*
|
RUN rm -rf /etc/ssh/*key*
|
||||||
RUN rm -fr /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
RUN rm -fr /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
||||||
RUN ln -s /sbin/agetty /sbin/getty
|
RUN ln -s /sbin/agetty /sbin/getty
|
||||||
|
Loading…
Reference in New Issue
Block a user