Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Public Utility Scripts
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UNL ITS
Public Utility Scripts
Commits
820966c8
Commit
820966c8
authored
5 years ago
by
Alan Nelson
Browse files
Options
Downloads
Patches
Plain Diff
Add generate_svc_account_key.sh
parents
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
generate_svc_account_key.sh
+11
-0
11 additions, 0 deletions
generate_svc_account_key.sh
with
11 additions
and
0 deletions
generate_svc_account_key.sh
0 → 100644
+
11
−
0
View file @
820966c8
#!/bin/bash
#
# This script generates an ed25519 SSH key for a service account,
# adds the public part to the service account's authorized_keys file,
# and prints the private part of the key to the console.
#
read
-p
'Service Account: '
account
sudo
-u
"
$account
"
-H
--
bash
-c
"cd ~; mkfifo key key.pub && cat key && cat key.pub >> /etc/ssh/authorized_keys/
$account
& echo
\"
y
\"
| ssh-keygen -oq -t ed25519 -N
\"\"
-f key &>/dev/null; rm key key.pub"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment