History log of /lxc/templates/lxc-sshd.in
Revision Date Author Comments Expand
94b8d2829edae0dbfd8c1a626f92f764c9df63ec 09-May-2017 Nikolay Martynov <(none)>

Change sshd template to work with Ubuntu 17.04 A few things have changed and this patch makes container generated for sshd work in Ubuntu Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

7e8aa95e439761d21c8667e503522a21b027a376 21-Feb-2016 Nikolay Martynov <mar.kolya@gmail.com>

Fix sshd template on systems with systemd Systems with systemd have /sbin/init as a symlink pointing to real init. Sshd template tries to bind-mount special init implementation. The problem is that one cannot bind-mount to a location that is a symlink. Fix this by deferencing /sbin/init symling and using that as bind-mount location. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

f24a52d5f588ff4e4575046903fb9498c376d833 29-Jan-2015 Stéphane Graber <stgraber@ubuntu.com>

Use consistent /proc, /sys and /sys/fs/cgroup (v2) - Implements mixed mode for /sys where it's mounted read-only but with /sys/devices/virtual/net/ writable. - Sets lxc.mount.auto to "cgroup:mixed proc:mixed sys:mixed" for all templates. - Drop any template-specific mount for /proc, /sys or /sys/fs/cgroup. - Get rid of the fstab file by default, using lxc.mount.entry instead. - Set sys:mixed as the default for "sys". sys:mixed is slightly more permissive than sys:ro so this shouldn't be a problem. The read-only bind mount of /sys on top of itself is there so that mountall and other init systems don't attempt to remount /sys read-write. v2 changes: - Fix the mount list, don't specify a source for the remount. - Update the documentation. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

d89de2399ce0e6c213a742c246574f2ca0afad0d 21-Jan-2015 Stéphane Graber <stgraber@ubuntu.com>

Set kmsg to 0 by default It's now been proven over and over again that the symlink from /dev/kmsg to /dev/console is harmful for everything but upstart systems. As Ubuntu is now switching over to systemd too, lets switch the default. Upstart users wishing to see boot messages can always set lxc.kmsg = 1 manually in their config (so long as they don't expect to then dist-upgrade the container to systemd succesfuly). Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

b78b2e23a17cdf59d057201508c1f0a90afb7e9e 08-Aug-2014 Nikolay Martynov <mar.kolya@gmail.com>

ssh: send hostname to dhcp server Send container's hostname to dhcp server when getting ip address. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

8a2fdf50ad3e771032476b1d0d65aa1cb44ee999 01-May-2014 Nikolay Martynov <mar.kolya@gmail.com>

use correct lxc-init path in sshd template lxc-init got moved into SBINDIR/init.lxc recently. This broke sshd template because path wasn't updated there. This patch should fix this issue. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

96283b546081e7ff709968378fca25cb44f1ab6c 19-Feb-2014 Stéphane Graber <stgraber@ubuntu.com>

templates: Fix bashisms in common code Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>

207bf0e475f1dc6e9a2dac2cee3a209b56427855 06-Feb-2014 Stéphane Graber <stgraber@ubuntu.com>

templates: Make sure usual locations are in PATH Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

c63c04fcaf1c3a78c70500eae253d72fa9c8358a 06-Feb-2014 TAMUKI Shoichi <tamuki@linet.gr.jp>

templates: improve refusing to run unprivileged For all templates except lxc-ubuntu-cloud and lxc-download, detect not only --mapped-uid but also --mapped-gid and error out. Detecting will not be done after -- parameter because of non-option parameters. Also, change the mode of lxc-archlinux.in 100755 to 100644. Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

8ec981fc8b0105da5f071e40811e0c2472a6c3c9 04-Feb-2014 Stéphane Graber <stgraber@ubuntu.com>

templates: Refuse to run unprivileged Only the download and ubuntu-cloud templates work with unprivileged containers, for all others, detect --mapped-uid and error out as early as possible, recommending the use of the download template. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>

17abf2784de1047fb2904ff130ee5efe4ea7b598 14-Jan-2014 Elan Ruusamäe <glen@delfi.ee>

handle simple bashisms: - [[ ]] -> [ ] - == -> = - source -> . - redirect of fd 200 is error in mksh, use fd 9 - &> /dev/null -> > /dev/null 2>&1 - useless function keyword - echo -e -> printf still left bash shebang which did not validate with checkbashism, mostly due 'type' being reported as bashism Signed-Off-By: Elan Ruusamäe <glen@delfi.ee> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

f4d5cc8e1f39d132b61e110674528cac727ae0e2 19-Dec-2013 Stéphane Graber <stgraber@ubuntu.com>

sshd: Don't bind-mount /sbin/init read-write lxc-sshd was mounting itself (the template script) as /sbin/init in the container using a writable bind-mount. This shouldn't be needed and could lead to quite a few problems should one of those containers overwrite /sbin/init for some reason. Instead simply move to a read-only bind-mount which should prevent any accidental dammage. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>

c01c25fcdd1e0cacad8075bcfcef4c8e8d4b8cb6 25-Nov-2013 Stéphane Graber <stgraber@ubuntu.com>

Tab/spaces consistency for templates Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>

853d58fdf5af0960b7b6edc9dea0fadddb8535f1 25-Nov-2013 Elan Ruusamäe <glen@delfi.ee>

use awk, instead of 'grep | awk' Signed-off-by: Elan Ruusamäe <glen@delfi.ee> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77 03-Sep-2013 Stéphane Graber <stgraber@ubuntu.com>

licensing: Add missing headers and FSF address Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>

/lxc/autogen.sh /lxc/doc/common_options.sgml.in /lxc/doc/legacy/lxc-ls.sgml.in /lxc/doc/lxc-attach.sgml.in /lxc/doc/lxc-cgroup.sgml.in /lxc/doc/lxc-checkconfig.sgml.in /lxc/doc/lxc-checkpoint.sgml.in /lxc/doc/lxc-clone.sgml.in /lxc/doc/lxc-console.sgml.in /lxc/doc/lxc-create.sgml.in /lxc/doc/lxc-destroy.sgml.in /lxc/doc/lxc-device.sgml.in /lxc/doc/lxc-execute.sgml.in /lxc/doc/lxc-freeze.sgml.in /lxc/doc/lxc-info.sgml.in /lxc/doc/lxc-kill.sgml.in /lxc/doc/lxc-ls.sgml.in /lxc/doc/lxc-monitor.sgml.in /lxc/doc/lxc-netstat.sgml.in /lxc/doc/lxc-ps.sgml.in /lxc/doc/lxc-restart.sgml.in /lxc/doc/lxc-start-ephemeral.sgml.in /lxc/doc/lxc-start.sgml.in /lxc/doc/lxc-stop.sgml.in /lxc/doc/lxc-top.sgml.in /lxc/doc/lxc-unfreeze.sgml.in /lxc/doc/lxc-unshare.sgml.in /lxc/doc/lxc-version.sgml.in /lxc/doc/lxc-wait.sgml.in /lxc/doc/lxc.conf.sgml.in /lxc/doc/lxc.sgml.in /lxc/doc/see_also.sgml.in /lxc/hooks/mountcgroups /lxc/hooks/mountecryptfsroot /lxc/lxc.spec.in /lxc/runapitests.sh /lxc/src/include/getline.c /lxc/src/include/getline.h /lxc/src/include/lxcmntent.c /lxc/src/include/lxcmntent.h /lxc/src/include/openpty.c /lxc/src/include/openpty.h /lxc/src/lxc/af_unix.c /lxc/src/lxc/af_unix.h /lxc/src/lxc/apparmor.c /lxc/src/lxc/apparmor.h /lxc/src/lxc/arguments.c /lxc/src/lxc/arguments.h /lxc/src/lxc/attach.c /lxc/src/lxc/attach.h /lxc/src/lxc/attach_options.h /lxc/src/lxc/bdev.c /lxc/src/lxc/bdev.h /lxc/src/lxc/caps.c /lxc/src/lxc/caps.h /lxc/src/lxc/cgroup.c /lxc/src/lxc/cgroup.h /lxc/src/lxc/checkpoint.c /lxc/src/lxc/commands.c /lxc/src/lxc/commands.h /lxc/src/lxc/conf.c /lxc/src/lxc/conf.h /lxc/src/lxc/confile.c /lxc/src/lxc/confile.h /lxc/src/lxc/console.c /lxc/src/lxc/console.h /lxc/src/lxc/error.c /lxc/src/lxc/error.h /lxc/src/lxc/execute.c /lxc/src/lxc/freezer.c /lxc/src/lxc/genl.c /lxc/src/lxc/genl.h /lxc/src/lxc/legacy/lxc-ls.in /lxc/src/lxc/list.c /lxc/src/lxc/list.h /lxc/src/lxc/log.c /lxc/src/lxc/log.h /lxc/src/lxc/lxc-destroy.in /lxc/src/lxc/lxc-device /lxc/src/lxc/lxc-ls /lxc/src/lxc/lxc-netstat.in /lxc/src/lxc/lxc-ps.in /lxc/src/lxc/lxc-start-ephemeral.in /lxc/src/lxc/lxc.functions.in /lxc/src/lxc/lxc.h /lxc/src/lxc/lxc_attach.c /lxc/src/lxc/lxc_cgroup.c /lxc/src/lxc/lxc_checkpoint.c /lxc/src/lxc/lxc_config.c /lxc/src/lxc/lxc_console.c /lxc/src/lxc/lxc_execute.c /lxc/src/lxc/lxc_freeze.c /lxc/src/lxc/lxc_info.c /lxc/src/lxc/lxc_init.c /lxc/src/lxc/lxc_kill.c /lxc/src/lxc/lxc_monitor.c /lxc/src/lxc/lxc_monitord.c /lxc/src/lxc/lxc_restart.c /lxc/src/lxc/lxc_start.c /lxc/src/lxc/lxc_stop.c /lxc/src/lxc/lxc_unfreeze.c /lxc/src/lxc/lxc_unshare.c /lxc/src/lxc/lxc_usernsexec.c /lxc/src/lxc/lxc_wait.c /lxc/src/lxc/lxccontainer.h /lxc/src/lxc/lxcseccomp.h /lxc/src/lxc/lxcutmp.c /lxc/src/lxc/lxcutmp.h /lxc/src/lxc/mainloop.c /lxc/src/lxc/mainloop.h /lxc/src/lxc/monitor.c /lxc/src/lxc/monitor.h /lxc/src/lxc/namespace.c /lxc/src/lxc/namespace.h /lxc/src/lxc/network.c /lxc/src/lxc/network.h /lxc/src/lxc/nl.c /lxc/src/lxc/nl.h /lxc/src/lxc/parse.c /lxc/src/lxc/parse.h /lxc/src/lxc/restart.c /lxc/src/lxc/rtnl.c /lxc/src/lxc/rtnl.h /lxc/src/lxc/seccomp.c /lxc/src/lxc/start.c /lxc/src/lxc/start.h /lxc/src/lxc/state.c /lxc/src/lxc/state.h /lxc/src/lxc/sync.c /lxc/src/lxc/sync.h /lxc/src/lxc/utils.c /lxc/src/lxc/utils.h /lxc/src/lxc/version.c /lxc/src/lxc/version.h /lxc/src/python-lxc/examples/api_test.py /lxc/src/python-lxc/examples/pyconsole-vte.py /lxc/src/python-lxc/examples/pyconsole.py /lxc/src/python-lxc/lxc.c /lxc/src/python-lxc/lxc/__init__.py /lxc/src/python-lxc/setup.py /lxc/src/tests/lxc-test-usernic lxc-altlinux.in lxc-archlinux.in lxc-busybox.in lxc-debian.in lxc-fedora.in lxc-opensuse.in lxc-oracle.in lxc-sshd.in
18efb001a4498f8fc62ab37f1db552fdf001e798 08-Jul-2013 Dwight Engen <dwight.engen@oracle.com>

fix sshd template Commit a0a2066d introduced an lxc subdir into the lxc-init path, but this was never reflected in the sshd template. Add it there. Don't have ssh-keygen ask for passphrase since host keys are not supposed to use them. Don't try to symlink kmsg since /dev is bind mounted readonly. Read-only bind mount some extra /etc directories, and sysfs which are needed by dhclient on Fedora and Oracle Linux. Fix mounting of /proc. Find sshd in more places by adding some common paths to $PATH, and use the found path to it instead of hardcoded /usr/sbin. Check for ifconfig command, and print out container's IP address. Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

1897e3bcd36af9f3fe6d3649910a9adb93e5e988 26-May-2013 Serge Hallyn <serge.hallyn@ubuntu.com>

Move container creation fully into the api 1. implement bdev->create: python and lua: send NULL for bdevtype and bdevspecs. They'll want to be updated to pass those in in a way that makes sense, but I can't think about that right now. 2. templates: pass --rootfs If the container is backed by a device which must be mounted (i.e. lvm) then pass the actual rootfs mount destination to the templates. Note that the lxc.rootfs can be a mounted block device. The template should actually be installing the rootfs under the path where the lxc.rootfs is *mounted*. Still, some people like to run templates by hand and assume purely directory backed containers, so continue to support that use case (i.e. if no --rootfs is listed). Make sure the templates don't re-write lxc.rootfs if it is already in the config. (Most were already checking for that) 3. Replace lxc-create script with lxc_create.c program. Changelog: May 24: when creating a container, create $lxcpath/$name/partial, and flock it. When done, close that file and unlink it. In lxc_container_new() and lxcapi_start(), check for this file. If it is locked, create is ongoing. If it exists but is not locked, create() was killed - remove the container. May 24: dont disk-lock during lxcapi_create. The partial lock is sufficient. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

eee3ba81c88e64b8a732694fc4843a39d5bde491 01-May-2013 Serge Hallyn <serge.hallyn@ubuntu.com>

templates: deny writes to host's clock (v2) Don't allow write to /dev/rtc0, and remove sys_time. Thanks, Christoph. v2: drop sys_time, sys_module, mac_admin and mac_override in all templates. Reported-by: Christoph Mitasch <cmitasch@thomas-krenn.com> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

14d9c0f09d1a55d124ef210a4b4e205c9fe7596c 06-Dec-2012 Stéphane Graber <stgraber@ubuntu.com>

Update for consistent indent This commit updates all scripts using mixed indent to a consistent 4 spaces indent. In the past quite a few of those scripts used tabs to instead of 8 spaces or instead of 4 spaces, sometimes mixing those in the same line and sometimes changing the tab width within the same file. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

eba7df9ee0a1963984ef212e7ddfc0e0835af288 06-Dec-2012 Stéphane Graber <stgraber@ubuntu.com>

templates: Make generated config consistent This updates all the templates and the configuration files to consistently use "key = value" everywhere. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>

ca0a33644ae47b802ce2ae7a96af70806e7266fe 14-Nov-2012 Serge Hallyn <serge.hallyn@ubuntu.com>

lxc-ssh: fix message about ssh key insertion Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

1881820ae4ff9004beef1bf7f04553580840441d 12-Nov-2012 Serge Hallyn <serge.halyn@ubuntu.com>

lxc-create: Make location of container rootfs configurable Make 'dir' an explicit backing store type, which accepts '--dir rootfs' as an option to specify a custom location for the container rootfs. Also update lxc-destroy to now remove the rootfs separately, as removing @LXCPATH@/$name may not hit it. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

337e14712e2bf568db73dd57c709b3364e26d798 25-Oct-2012 Stéphane Graber <stgraber@ubuntu.com>

sshd: run dhclient; allow adding a root ssh key Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

f02ce27d4b1a9d01b88d0ffaf626e5bafa671bf0 25-Oct-2012 Stéphane Graber <stgraber@ubuntu.com>

Add lxc.aa_profile example to all templates LXC has optional apparmor support, default profile is lxc-container-default. This change adds a commented "lxc.aa_profile = default" line to all templates, uncommenting this will bypass apparmor for the container. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>

80a881b232b8955b85b360d4def99e6e680ff61b 31-Jul-2012 Serge Hallyn <serge.hallyn@ubuntu.com>

templates: use relative paths when creating containers At the same time, allow lxc.mount.entry to specify an absolute target path relative to /var/lib/lxc/CN/rootfs, even if rootfs is a blockdev. Otherwise all such entries are ignored for blockdev-backed containers. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>

b91b1cd79c1857a8aa5f329415cb23175b959cc1 24-Oct-2011 Serge E. Hallyn <serge.hallyn@canonical.com>

Let sshd template work on ubuntu systems. /dev/shm is a symlink to /run/shm, so we need /run/shm to exist in the container rootfs. Also, /dev/mqueue does not exist on the host, and can't be created by the container. But we don't really need it so ignore that. Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>

70e279574cd07e743d1f6e498d569add3fa6a7de 17-Jun-2010 Daniel Lezcano <daniel.lezcano@fr.ibm.com>

fix sshd template Fixed the sshd template example. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>

0830689d862752819db9552b2ba8ef58fe7cafaa 16-Jun-2010 Panagiotis H.M. Issaris <panagiotis@gmail.com>

Forgotten @LIBEXECDIR@ replacement Forgotten part of commit d674be08d4b282bb4717c51440811e39d3c2431e Signed-off-by: Panagiotis H.M. Issaris <takis@issaris.org> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>

c01d62f21b21ba6c2b8b78ab3c2b37cc8f8fd265 07-Jun-2010 Daniel Lezcano <dlezcano@fr.ibm.com>

move script templates to an adequate place At present the lxc-{template} scripts are installed in the $bindir. This is not the right place as specified by the FHS, so they go to $libdir/lxc/templates. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>