[Bio-linux-dev] Path and umask for root on BL6

Tim Booth tbooth at ceh.ac.uk
Mon May 10 11:48:37 EDT 2010


OK, looking through the rebuilder script for BL, it is set up to
explicitly preserve /root/.profile which suggests that the file should
contain something important.  However, there is no /root/.profile either
in the BL6 image or in the old BL5 image, suggesting it got lost in the
wash some time ago.

I have added the the /root/.profile shown below to the next iteration of
the image.

note - It seems that Ubuntu by default puts /usr/sbin and /sbin into the
path for any admin user as well as for root.  I don't know where you
would put the setting if you happened to want this to happen in the same
way for /opt/local/sbin.

>>>contents of /root/.bashrc

#Because the default umask is 077, and this is rarely suitable for root,
#ensure it is set to the more normal 022
umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

<<<SNIP

On Mon, 2010-05-10 at 15:31 +0100, Tony Travis wrote:
> On 10/05/10 13:07, Tim Booth wrote:
> > [...]
> > % sudo bash
> > # umask
> >
> > You should get the result "0022".  This also applies to gksu.  So could
> > you please confirm that this is the result on your machine and, if so,
> > where you are seeing the more restrictive umask being applied.
> 
> Hello, Tim.
> 
> I normally use "sudo -i", which simulates a root login:
> 
>  > manager at topcat[/manager] sudo bash 
>   [ 3:17PM]
>  > root at topcat:~# umask
>  > 0022
>  > root at topcat:~# exit
>  > manager at topcat[/manager] sudo -i 
>   [ 3:17PM]
>  > root at topcat:~# umask
>  > 0077
> 
> I've copied /etc/skel/.profile to /root/.profile and modified it to 
> override the default umask and added /opt/local/[s]bin to the PATH:
> 
> root at topcat:~# diff -Naur /etc/skel/.profile /root/.profile
> --- /etc/skel/.profile	2010-04-19 03:15:58.000000000 +0100
> +++ /root/.profile	2010-05-10 15:20:51.086746274 +0100
> @@ -6,7 +6,7 @@
> 
>   # the default umask is set in /etc/profile; for setting the umask
>   # for ssh logins, install and configure the libpam-umask package.
> -#umask 022
> +umask 022
> 
>   # if running bash
>   if [ -n "$BASH_VERSION" ]; then
> @@ -20,3 +20,5 @@
>   if [ -d "$HOME/bin" ] ; then
>       PATH="$HOME/bin:$PATH"
>   fi
> +
> +PATH=$PATH:/opt/local/sbin:/opt/local/bin
> 
> > [...]
> >> The dual head nodes of our Beowulf are now running Bio-Linux 6 :-)
> >
> > Nice one.  I hope your users like the new system.
> 
> They can't get in yet - NIS and the automounter are not quite ready, but 
> should be running by tomorrow.
> 
> Bye,
> 
>    Tony.
-- 
Tim Booth <tbooth at ceh.ac.uk>
NERC Environmental Bioinformatics Centre 
at CEH Wallingford
+44 1491 69 2705


-- 
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.




More information about the Bio-linux-devel mailing list