[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#876464: marked as done (cloud.debian.org: vagrant home directory has no files from /etc/skel)



Your message dated Fri, 03 Nov 2017 10:44:07 +0100
with message-id <c889ab9e7bbc4097475329d7877550b4@libera.cc>
and subject line (pas d'objet)
has caused the Debian Bug report #876464,
regarding cloud.debian.org: vagrant home directory has no files from /etc/skel
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
876464: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876464
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: cloud.debian.org
Severity: normal

Dear Maintainer,

Vagrant base box debian/stretch64 (and debian/jessie64) includes a home
directory /home/vagrant containing only the .ssh directory: none of .bashrc,
.profile and .bash_logout are present (i.e. files normally copied from
/etc/skel). This makes the Vagrant user behaviour slightly different than
expected, and makes e.g. custom .bashrc not run without adding a .profile.

The included patch for debian-vm-templates fixes it by having useradd make the
home directory, using the default skeleton directory files.


From 68de99c4cf2114bfdde0077ff4afea6a52c33f40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= <m.maslowski@clearcode.cc>
Date: Fri, 22 Sep 2017 16:26:58 +0200
Subject: [PATCH] helpers/vagrant-setup: make useradd create the vagrant user
 home directory

It populates the home directory with files from /etc/skel, so e.g. .bashrc is
available and is loaded when logging in.
---
 helpers/vagrant-setup | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/helpers/vagrant-setup b/helpers/vagrant-setup
index 7f8af9f..2754d41 100755
--- a/helpers/vagrant-setup
+++ b/helpers/vagrant-setup
@@ -41,9 +41,7 @@ chroot $fs apt-get purge -qy dctrl-tools
 # setup vagrant user
 #######################################################################
 chroot $fs id ubuntu >/dev/null 2>&1 && chroot $fs deluser ubuntu
-chroot $fs id vagrant >/dev/null 2>&1 || chroot $fs useradd --uid 1000 --shell /bin/bash vagrant
-mkdir -p $fs/home/vagrant
-chroot $fs chown vagrant:vagrant /home/vagrant
+chroot $fs id vagrant >/dev/null 2>&1 || chroot $fs useradd --create-home --uid 1000 --shell /bin/bash vagrant
 mkdir -p $fs/home/vagrant/.ssh
 chmod 700 $fs/home/vagrant/.ssh
 cat > $fs/home/vagrant/.ssh/authorized_keys << EOF
--
2.11.0



-- System Information:
Debian Release: 9.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

--- End Message ---
--- Begin Message --- 9.2 boxes for stretch64 and contrib-stretch64 have been uploaded at https://app.vagrantup.com/debian, they include the fix
--- End Message ---

Reply to: