Commit de94641c authored by Michael Shigorin's avatar Michael Shigorin

vm-ssh: renamed to net-ssh and cleaned up

There was no need to split carrying over the pubkey and tightening up permissions on the file and its parent directory to be done in two separate scripts; this should be more generic now as a bonus. Users adjusted accordingly.
parent 62a37f37
......@@ -35,13 +35,13 @@ endif
ifeq (vm,$(IMAGE_CLASS))
# NB: early dependency on use/kernel is on intent
vm/.arm-base: profile/bare use/kernel use/net-eth/dhcp use/vm-ssh; @:
vm/.arm-base: profile/bare use/kernel use/net-eth/dhcp use/net-ssh; @:
@$(call add,BASE_PACKAGES,interactivesystem e2fsprogs)
@$(call add,BASE_PACKAGES,apt)
@$(call add,BASE_PACKAGES,mkinitrd uboot-tools)
@$(call set,BRANDING,altlinux-kdesktop)
vm/.cubox-bare: vm/.arm-base use/armh use/armh-cubox use/services/ssh +systemd \
vm/.cubox-bare: vm/.arm-base use/armh use/armh-cubox use/net-ssh +systemd \
use/repo use/branding use/xdg-user-dirs/deep +pulse
@$(call set,KFLAVOURS,cubox)
@$(call set,BRANDING,altlinux-kdesktop)
......
......@@ -72,7 +72,7 @@ endif # IMAGE_CLASS: ve
ifeq (vm,$(IMAGE_CLASS))
vm/net-static: vm/bare use/vm-net/static use/vm-ssh
vm/net-static: vm/bare use/vm-net/static use/net-ssh
@$(call set,VM_NET_IPV4ADDR,10.0.2.16/24)
@$(call set,VM_NET_IPV4GW,10.0.2.2)
......
......@@ -4,7 +4,7 @@ ifeq (vm,$(IMAGE_CLASS))
vm/bare: vm/.bare
@$(call add,BASE_PACKAGES,apt)
vm/net: vm/bare use/vm-net/dhcp use/vm-ssh
vm/net: vm/bare use/vm-net/dhcp use/net-ssh
@$(call add,BASE_PACKAGES,su)
# NB: use/x11 employs some installer-feature packages
......
Эта фича предназначена для добавления в образ поддержки SSH:
добавляется клиент и конфигурируется сервер (требуется задание
пути к существующему публичному ключу посредством переменной SSH_KEY).
use/vm-ssh:
use/net-ssh: use/net use/services
@$(call add_feature)
@$(call add,THE_LISTS,openssh)
@$(call add,DEFAULT_SERVICES_ENABLE,sshd)
......@@ -2,11 +2,12 @@ ifdef BUILDDIR
include $(BUILDDIR)/distcfg.mk
# prepare the provided public SSH key to be carried over into the VM image
# prepare the provided public SSH key to be carried over into the image
all: SSH_DIR = $(BUILDDIR)/files/root/.ssh
all:
@if [ -s "$(SSH_KEY)" ]; then \
install -pD "$(SSH_KEY)" "$(SSH_DIR)/authorized_keys"; \
mkdir -pm0700 "$(SSH_DIR)"; \
install -pm0600 "$(SSH_KEY)" "$(SSH_DIR)/authorized_keys"; \
fi
endif
......@@ -4,9 +4,3 @@ use/services: sub/rootfs
@$(call xport,DEFAULT_SERVICES_DISABLE)
@$(call xport,SERVICES_ENABLE)
@$(call xport,SERVICES_DISABLE)
# some presets
use/services/ssh: use/services use/net
@$(call add,THE_LISTS,openssh)
@$(call add,DEFAULT_SERVICES_ENABLE,sshd)
Эта фича предназначена для добавления в образ виртуальной машины
поддержки SSH: добавляется клиент и конфигурируется сервер
(требуется задание пути к существующему публичному ключу
посредством переменной SSH_KEY).
Фактически требует один из вариантов use/vm-net для осмысленности.
#!/bin/sh
# tighten up permissions just in case
[ ! -d /root/.ssh ] || chmod 700 /root/.ssh
[ ! -f /root/.ssh/authorized_keys ] || chmod 600 /root/.ssh/authorized_keys
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment