Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anton Palgunov
mkimage-profiles
Commits
ff66f763
Commit
ff66f763
authored
Nov 11, 2022
by
Paul Wolneykien
Committed by
Anton Midyukov
Jan 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net-ssh: Use two-pass method to install an authorized key for root
parent
0feda29c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
generate.mk
features.in/net-ssh/generate.mk
+3
-3
51-root-ssh-key
features.in/net-ssh/rootfs/image-scripts.d/51-root-ssh-key
+10
-0
No files found.
features.in/net-ssh/generate.mk
View file @
ff66f763
...
...
@@ -3,11 +3,11 @@ ifneq (,$(BUILDDIR))
include $(BUILDDIR)/distcfg.mk
# prepare the provided public SSH key to be carried over into the image
all:
SSH_DIR = $(BUILDDIR)/files/root/.ssh
all:
TMPDIR = $(BUILDDIR)/files/tmp
all:
@if [ -s "$(SSH_KEY)" ]; then \
mkdir -p
m0700 "$(SSH_
DIR)"; \
install -pm0600 "$(SSH_KEY)" "$(SSH_DIR)/authorized_keys
"; \
mkdir -p
"$(TMP
DIR)"; \
cp -v "$(SSH_KEY)" "$(TMPDIR)/root_ssh_key.pub
"; \
fi
endif
features.in/net-ssh/rootfs/image-scripts.d/51-root-ssh-key
0 → 100755
View file @
ff66f763
#!/bin/sh -efu
TMPDIR
=
/tmp
SSH_DIR
=
/root/.ssh
if
[
-e
"
$TMPDIR
/root_ssh_key.pub"
]
;
then
mkdir
-pm0700
"
$SSH_DIR
"
install
-v
-pm0600
"
$TMPDIR
/root_ssh_key.pub"
"
$SSH_DIR
/authorized_keys"
rm
-fv
"
$TMPDIR
/root_ssh_key.pub"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment