LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-18-2011, 12:31 AM   #1
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
Question bashrc and sudo issues


Hi,

I have not been on in about a month or 2. I have no idea how to list this thread. I am hoping that someone like tex can help out. Being lazy with ubuntu seems to have been badong. Any way, I got issues. Please dont flame me.

Ok, I had 2 physical machines and 3 vms. VM's ran under Vbox-ose via a bridge. OS's are buntu x2 and one centOS box. I installed webmin to make things easy ( i thought ). However, after setting webmin, my I have been randomly loosing PATH's. I mean, one minuet i can run sudo apt-get and the next the whole PATH is gone.
I tried a compare of my "home" box's bashrc and bash_profile against the other machins, and outside of some alias for colr and the like nothing seems to stand out. Even if I su - to root I am not getting access to the needed paths. Now, while I could export the correct path, I am more conserned with the why of it all. I would have thought that as long as my group setting on my ssh users were all correct AND the environment had not been changed, all would be good.

I can provide more info if someone wants to help me out with this. HOwever, it drove me to a six pack. 8S

I have read the man pages. I have used google. I have checked the logs. The logs by the way showed a lil hammering on one of the boxes for root access. [I]t wasnt me. However, I dont seem to be able to see a time stamp.

Well, thats what I got. I could use some help from someone that walks the talk. T
 
Old 06-18-2011, 06:23 AM   #2
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 106Reputation: 106
Lightbulb


If you have checked the user bash profile. I would recommend looking at the system bashrc. (/etc/bash.bashrc).

First I would open two terminals and in one echo $PATH and compare to the configurations which you can open using vi ( or whatever program you prefer) in the other.

Step 1 : Asses environment

Quote:

joe@Tux-Box:~$ echo $PATH
/usr/local/sbin:/usr/lib:/usr/lib64:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/home/joe/Scripts

Step 2 : Compare

Quote:

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
# ;;
#*)
# ;;
#esac

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1
return $?
elif [ -x /usr/share/command-not-found ]; then
/usr/bin/python /usr/share/command-not-found -- $1
return $?
else
return 127
fi
}
fi


# JOE MODS---Debian Wheezy------4/11




PATH=/usr/local/sbin:/usr/lib:/usr/lib64:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/home/joe/Scripts


function tunes ()

{

randomplay -d 5 /media/N-Space/Tunes/

}


HISTCONTROL=erasedups

HISTFILESIZE=3000
HISTSIZE=3000

 
1 members found this post helpful.
Old 06-18-2011, 12:28 PM   #3
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Original Poster
Rep: Reputation: 51
Hey,

Thanks for your help. I am trying to find out the WHY of the change. I have added needed PATH. I am just getting changes in them. Either way, trying to figure out if it is something I did or if there is a conflict somewhere. I dont know what could cause the paths available to me WHILE logged in to change / drop.
 
Old 06-19-2011, 06:43 AM   #4
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 106Reputation: 106
Ghost in the Machine

Not sure of any program that would overwrite that but I am also a bit of a

Good Luck.
 
  


Reply

Tags
bashrc sudoers



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
How to force sudo to use ~/.bashrc aliases? bigrigdriver Linux - General 10 02-24-2008 05:14 PM
Setting path: /etc/profile, /etc/bashrc or ~/.bashrc Swakoo Linux - General 1 08-07-2007 10:59 PM
Issues with sudo and Gnome apps livewire98801 Linux - Security 1 06-03-2007 06:13 PM
sudo and su issues - FC4 crazibri Fedora 2 03-12-2006 01:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration