Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
d98e80e2
Commit
d98e80e2
authored
Apr 03, 2017
by
Stéphane Graber
Committed by
GitHub
Apr 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1488 from evgeni/stable-2.0-no-passwords
[stable-2.0] default password cleanup
parents
20f3261a
8c7dddc2
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
8 additions
and
55 deletions
+8
-55
lxc-altlinux.in
templates/lxc-altlinux.in
+2
-1
lxc-busybox.in
templates/lxc-busybox.in
+0
-29
lxc-debian.in
templates/lxc-debian.in
+0
-3
lxc-gentoo.in
templates/lxc-gentoo.in
+0
-3
lxc-openmandriva.in
templates/lxc-openmandriva.in
+0
-1
lxc-opensuse.in
templates/lxc-opensuse.in
+0
-1
lxc-oracle.in
templates/lxc-oracle.in
+3
-5
lxc-plamo.in
templates/lxc-plamo.in
+0
-3
lxc-slackware.in
templates/lxc-slackware.in
+0
-4
lxc-sparclinux.in
templates/lxc-sparclinux.in
+3
-5
No files found.
templates/lxc-altlinux.in
View file @
d98e80e2
...
@@ -43,7 +43,6 @@ cache_base=@LOCALSTATEDIR@/cache/lxc/altlinux/$arch
...
@@ -43,7 +43,6 @@ cache_base=@LOCALSTATEDIR@/cache/lxc/altlinux/$arch
default_path
=
@LXCPATH@
default_path
=
@LXCPATH@
default_profile
=
default
default_profile
=
default
profile_dir
=
/etc/lxc/profiles
profile_dir
=
/etc/lxc/profiles
root_password
=
rooter
lxc_network_type
=
veth
lxc_network_type
=
veth
lxc_network_link
=
virbr0
lxc_network_link
=
virbr0
...
@@ -156,8 +155,10 @@ EOF
...
@@ -156,8 +155,10 @@ EOF
mkdir
-m
755
${
dev_path
}
/net
mkdir
-m
755
${
dev_path
}
/net
mknod
-m
666
${
dev_path
}
/net/tun c 10 200
mknod
-m
666
${
dev_path
}
/net/tun c 10 200
if
[
-n
"
${
root_password
}
"
]
;
then
echo
"setting root passwd to
$root_password
"
echo
"setting root passwd to
$root_password
"
echo
"root:
$root_password
"
|
chroot
$rootfs_path
chpasswd
echo
"root:
$root_password
"
|
chroot
$rootfs_path
chpasswd
fi
return
0
return
0
}
}
...
...
templates/lxc-busybox.in
View file @
d98e80e2
...
@@ -330,35 +330,6 @@ configure_busybox()
...
@@ -330,35 +330,6 @@ configure_busybox()
chmod
+s
$rootfs
/bin/passwd
chmod
+s
$rootfs
/bin/passwd
touch
$rootfs
/etc/shadow
touch
$rootfs
/etc/shadow
# setting passwd for root
CHPASSWD_FILE
=
$rootfs
/root/chpasswd.sh
cat
<<
EOF
>
$CHPASSWD_FILE
echo "setting root password to \"root\""
mount -n --bind /lib
$rootfs
/lib
if [ \
$?
-ne 0 ]; then
echo "Failed bind-mounting /lib at
$rootfs
/lib"
exit 1
fi
chroot
$rootfs
chpasswd <<EOFF 2>/dev/null
root:root
EOFF
if [ \
$?
-ne 0 ]; then
echo "Failed to change root password"
exit 1
fi
umount
$rootfs
/lib
EOF
lxc-unshare
-s
MOUNT
--
/bin/sh <
$CHPASSWD_FILE
rm
$CHPASSWD_FILE
return
0
return
0
}
}
...
...
templates/lxc-debian.in
View file @
d98e80e2
...
@@ -158,9 +158,6 @@ EOF
...
@@ -158,9 +158,6 @@ EOF
echo
"Timezone in container is not configured. Adjust it manually."
echo
"Timezone in container is not configured. Adjust it manually."
fi
fi
echo
"root:root"
|
chroot
"
$rootfs
"
chpasswd
echo
"Root password is 'root', please change !"
return
0
return
0
}
}
...
...
templates/lxc-gentoo.in
View file @
d98e80e2
...
@@ -654,8 +654,6 @@ container_auth()
...
@@ -654,8 +654,6 @@ container_auth()
printf
" => done. if you didn't specify , default is 'toor'
\n
"
printf
" => done. if you didn't specify , default is 'toor'
\n
"
if
[[
-n
"
${
forced_password
}
"
]]
;
then
if
[[
-n
"
${
forced_password
}
"
]]
;
then
store_user_message
"
${
user
}
has the password you give for him"
store_user_message
"
${
user
}
has the password you give for him"
else
store_user_message
"
${
user
}
has the default password 'toor', please change it ASAP"
fi
fi
fi
fi
...
@@ -779,7 +777,6 @@ set_default_arch
...
@@ -779,7 +777,6 @@ set_default_arch
mirror
=
"http://distfiles.gentoo.org"
mirror
=
"http://distfiles.gentoo.org"
user
=
"root"
user
=
"root"
password
=
"toor"
tty
=
1
tty
=
1
settings
=
"common"
settings
=
"common"
options
=
$(
getopt
-o
hp:n:a:FcPv:t:S:u:w:s:m:
-l
help
,rootfs:,path:,name:,arch:,flush-cache,cache-only,private-portage,variant:,portage-dir:,tarball:,auth-key:,user:,autologin,password:,settings:,mirror:,tty:
--
"
$@
"
)
options
=
$(
getopt
-o
hp:n:a:FcPv:t:S:u:w:s:m:
-l
help
,rootfs:,path:,name:,arch:,flush-cache,cache-only,private-portage,variant:,portage-dir:,tarball:,auth-key:,user:,autologin,password:,settings:,mirror:,tty:
--
"
$@
"
)
...
...
templates/lxc-openmandriva.in
View file @
d98e80e2
...
@@ -46,7 +46,6 @@ hostarch=$(uname -m)
...
@@ -46,7 +46,6 @@ hostarch=$(uname -m)
cache_base
=
"
${
LXC_CACHE_PATH
:-
@LOCALSTATEDIR@/cache/lxc/openmandriva/
$arch
}
"
cache_base
=
"
${
LXC_CACHE_PATH
:-
@LOCALSTATEDIR@/cache/lxc/openmandriva/
$arch
}
"
default_path
=
@LXCPATH@
default_path
=
@LXCPATH@
default_profile
=
default
default_profile
=
default
root_password
=
root
lxc_network_type
=
veth
lxc_network_type
=
veth
lxc_network_link
=
br0
lxc_network_link
=
br0
...
...
templates/lxc-opensuse.in
View file @
d98e80e2
...
@@ -112,7 +112,6 @@ EOF
...
@@ -112,7 +112,6 @@ EOF
touch
$rootfs
/etc/sysconfig/kernel
touch
$rootfs
/etc/sysconfig/kernel
echo
"Please change root-password !"
echo
"Please change root-password !"
echo
"root:root"
| chpasswd
-R
$rootfs
return
0
return
0
}
}
...
...
templates/lxc-oracle.in
View file @
d98e80e2
...
@@ -462,12 +462,10 @@ EOF
...
@@ -462,12 +462,10 @@ EOF
fi
fi
fi
fi
# add oracle user
, set root password
# add oracle user
chroot
$container_rootfs
useradd
-m
-s
/bin/bash oracle
chroot
$container_rootfs
useradd
-m
-s
/bin/bash oracle
echo
"oracle:oracle"
|
chroot
$container_rootfs
chpasswd
printf
"Added container user:
\0
33[1moracle
\0
33[0m
\n
"
echo
"root:root"
|
chroot
$container_rootfs
chpasswd
printf
"Added container user:
\0
33[1mroot
\0
33[0m
\n
"
printf
"Added container user:
\0
33[1moracle
\0
33[0m password:
\0
33[1moracle
\0
33[0m
\n
"
printf
"Added container user:
\0
33[1mroot
\0
33[0m password:
\0
33[1mroot
\0
33[0m
\n
"
}
}
# create the container's lxc config file
# create the container's lxc config file
...
...
templates/lxc-plamo.in
View file @
d98e80e2
...
@@ -186,9 +186,6 @@ configure_plamo() {
...
@@ -186,9 +186,6 @@ configure_plamo() {
# glibc configure
# glibc configure
mv
$rootfs
/etc/ld.so.conf
{
.new,
}
mv
$rootfs
/etc/ld.so.conf
{
.new,
}
chroot
$rootfs
ldconfig
chroot
$rootfs
ldconfig
# root password
echo
"Setting root password to 'root'..."
echo
"root:root"
|
chroot
$rootfs
chpasswd
echo
"Please change root password!"
echo
"Please change root password!"
ed -
$rootfs
/etc/rc.d/rc.S <<-
"EOF"
ed -
$rootfs
/etc/rc.d/rc.S <<-
"EOF"
/^mount
-w
-n
-t
proc/
;
/^mkdir
\/
dev
\/
shm/-1d
/^mount
-w
-n
-t
proc/
;
/^mkdir
\/
dev
\/
shm/-1d
...
...
templates/lxc-slackware.in
View file @
d98e80e2
...
@@ -471,10 +471,6 @@ sed -i 's/.*genpowerfail.*//' $rootfs/etc/inittab
...
@@ -471,10 +471,6 @@ sed -i 's/.*genpowerfail.*//' $rootfs/etc/inittab
# add a message to rc.local that confirms successful container startup
# add a message to rc.local that confirms successful container startup
echo "echo ; echo \"* container $name started. *\" ; echo" >> $rootfs/etc/rc.d/rc.local
echo "echo ; echo \"* container $name started. *\" ; echo" >> $rootfs/etc/rc.d/rc.local
# set a default combination for the luggage
echo "root:root" | chroot $rootfs chpasswd
echo "Root default password is 'root', please change it!"
# borrow the time configuration from the local machine
# borrow the time configuration from the local machine
cp -a /etc/localtime $rootfs/etc/localtime
cp -a /etc/localtime $rootfs/etc/localtime
...
...
templates/lxc-sparclinux.in
View file @
d98e80e2
...
@@ -296,12 +296,10 @@ EOF
...
@@ -296,12 +296,10 @@ EOF
echo
"Timezone in container is not configured. Adjust it manually."
echo
"Timezone in container is not configured. Adjust it manually."
fi
fi
# add oracle user
, set root password
# add oracle user
chroot
$container_rootfs
useradd
-m
-s
/bin/bash oracle
chroot
$container_rootfs
useradd
-m
-s
/bin/bash oracle
echo
"oracle:oracle"
|
chroot
$container_rootfs
chpasswd
printf
"Added container user:
\0
33[1moracle
\0
33[0m
\n
"
echo
"root:root"
|
chroot
$container_rootfs
chpasswd
printf
"Added container user:
\0
33[1mroot
\0
33[0m
\n
"
printf
"Added container user:
\0
33[1moracle
\0
33[0m password:
\0
33[1moracle
\0
33[0m
\n
"
printf
"Added container user:
\0
33[1mroot
\0
33[0m password:
\0
33[1mroot
\0
33[0m
\n
"
}
}
# create the container's lxc config file
# create the container's lxc config file
...
...
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