"sudo -i" does not read .profile when root uses bash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
According to `man sudo` `sudo -i` is supposed to read `.profile`, but apparently it doesn't since adding `alias ll='ls -la'` to the end of `/root/.profile` causes `ll` to fail with `ll: command not found`, but the alias should be available if `.profile` was read. `root` uses `/bin/bash` according to `/etc/passwd`.
Now, I got it. /root/.profile is only sourced at the first sudo -i after reboot (or maybe display manager (re-)login), not at every following sudo -i - at least in gnome-terminal. If sudo -i is run once when /root/.bash_profile is present it is sourced (and /root/.profile skipped as expected) and if it /root/.bash_profile is removed every following invokation of sudo -i causes /root/.profile to be sourced. That not right, right?
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: sudo 1.8.16-0ubuntu1.1
ProcVersionSign
Uname: Linux 4.4.0-34-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Aug 11 04:35:28 2016
InstallationDate: Installed on 2015-12-12 (242 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: sudo
UpgradeStatus: Upgraded to xenial on 2016-03-14 (149 days ago)
VisudoCheck:
/etc/sudoers: Analyse OK
/etc/sudoers.
modified.
modified.
description: | updated |