LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-30-2012, 12:18 PM   #1
ecataranciuc
LQ Newbie
 
Registered: Jul 2012
Location: Chisinau, Republic of Moldova
Distribution: Gentoo; CentOS 5, 6
Posts: 12

Rep: Reputation: Disabled
SSH without root environment variables exported on CentOS 5.8 + SELinux


Hello!
I have a server on CentOS 5.8 + SELinux. The problem is that environment variables are not set up at login time through SSH. For example:
1. I login through SSH as a regular user.
2. su as root.
3. Trying to use any command from /sbin without the full path.
4. I get a "bash: *: command not found" error.
If I do "source /etc/profile" I can use the commands from /sbin without specifying the full path.
It is not because of SELinux. I disabled it and got the same result. On CentOS 6.3 I didn't have this problem. The OpenSSH version was a newer one though. Don't remember which.
How can I solve this?

uname -r: 2.6.18-308.el5xen
OpenSSH_4.3p2
 
Old 07-30-2012, 12:50 PM   #2
mesiol
Member
 
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731

Rep: Reputation: 137Reputation: 137
Did you try
Code:
su -
?
 
Old 07-30-2012, 01:03 PM   #3
ecataranciuc
LQ Newbie
 
Registered: Jul 2012
Location: Chisinau, Republic of Moldova
Distribution: Gentoo; CentOS 5, 6
Posts: 12

Original Poster
Rep: Reputation: Disabled
OK. Got it working. But why on a newer version of CentOS and SSH everything was working without "su -", just "su"?!

Last edited by ecataranciuc; 07-30-2012 at 01:39 PM.
 
Old 07-31-2012, 06:30 AM   #4
MCD555
Member
 
Registered: May 2009
Location: Milan, Italy
Distribution: Ubuntu, Debian, Fedora, Oracle Linux
Posts: 104

Rep: Reputation: 9
The su - command set up all envionment variables and paths of root.
Probably in 5.8 normal users, for security reason, have a better profiles!
 
Old 07-31-2012, 07:12 AM   #5
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,319

Rep: Reputation: 252Reputation: 252Reputation: 252
You can define for SSH in /etc/ssh/sshd.config whether anything should be inherited from the client environment with entries in AcceptEnv. Maybe it changed. Does the normal user already have the ability to execute programs form /sbin without specifying the complete path?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] using ssh cant access applications off of host, problem with environment variables josip76 Programming 15 10-22-2010 12:31 AM
root environment variables/group not set bratieres Suse/Novell 1 11-22-2006 07:14 AM
SSH Displaying Environment Variables movitto Linux - Networking 5 08-12-2005 10:51 AM
retaining environment variables using ssh lightningdan Linux - Software 3 12-15-2004 05:43 PM
Environment variables and runnning programes as root marghorp Linux - Software 2 04-19-2004 05:34 PM


All times are GMT -5. The time now is 08:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration