Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
servers-config
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Sistemisti
servers-config
Commits
93919234
Commit
93919234
authored
Mar 02, 2018
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxd-container: rename "manage" user to "manager" during bootstrap
parent
8d8c8740
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
roles/lxd-container/templates/bootstrap-container.sh.j2
roles/lxd-container/templates/bootstrap-container.sh.j2
+9
-9
No files found.
roles/lxd-container/templates/bootstrap-container.sh.j2
View file @
93919234
...
...
@@ -15,21 +15,21 @@ ex() {
ex apt-get update
ex apt-get
install
python openssh-server
sudo
-y
# Create the "manage" user in the passwordless sudo group
# Create the "manage
r
" user in the passwordless sudo group
if
!
ex
grep
-q
-E
"^passwordless-sudo:"
/etc/group
;
then
ex addgroup passwordless-sudo
fi
if
!
ex
grep
-q
-E
"^manage:"
/etc/passwd
;
then
ex adduser manage
--home
/home/manage
--gecos
""
--disabled-password
ex adduser manage passwordless-sudo
if
!
ex
grep
-q
-E
"^manage
r
:"
/etc/passwd
;
then
ex adduser manage
r
--home
/home/manager
--gecos
""
--disabled-password
ex adduser manage
r
passwordless-sudo
fi
# Allow the passwordless-sudo group to use... well... passwordless sudo?
echo
"%passwordless-sudo ALL=(ALL:ALL) NOPASSWD:ALL"
|
\
ex bash
-c
"cat >> /etc/sudoers"
# Authorize the hypervisor manage
to connect to the guest manage
ex
sudo
-u
manage
mkdir
-p
/home/manage
/.ssh
cat
/home/manage/.ssh/authorized_keys |
\
ex
sudo
-u
manage
bash
-c
"cat > /home/manage
/.ssh/authorized_keys"
ex
chmod
0600 /home/manage/.ssh/authorized_keys
# Authorize the hypervisor manage
r to connect to the guest manager
ex
sudo
-u
manage
r
mkdir
-p
/home/manager
/.ssh
cat
/home/manage
r
/.ssh/authorized_keys |
\
ex
sudo
-u
manage
r bash
-c
"cat > /home/manager
/.ssh/authorized_keys"
ex
chmod
0600 /home/manage
r
/.ssh/authorized_keys
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