LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-25-2009, 09:52 AM   #1
plesset
LQ Newbie
 
Registered: Oct 2008
Location: Reykjavik, Iceland
Distribution: openSUSE 12-2, Debian-Wheezy, Windows 7
Posts: 17

Rep: Reputation: 0
Accessing environmental variables through ssh


I'm trying to access a few environmental variables on a remote machine using ssh. The machines are running Debian 5. First I tried to set "export ABCDEF=abcdef" in my .bashrc file, but got something like :

(On the "local" machine)
andri@kaksi:~$ rsh kolme 'echo $ABCDEF'

andri@kaksi:~$ rsh kolme 'echo $HOME'
/home/andri

(On the remote machine)
andri@kolme:~$ echo $ABCDEF
abcdef

Same happens when using ssh instead of rsh. It seems like only the basic variables get set. Non of the user specified variables are defined. I tried moving the ABCDEF variable to /etc/profile, but it gave the same results.

So the question is, where should I define the variable?

Cheers,
Andri
 
Old 02-25-2009, 05:29 PM   #2
plesset
LQ Newbie
 
Registered: Oct 2008
Location: Reykjavik, Iceland
Distribution: openSUSE 12-2, Debian-Wheezy, Windows 7
Posts: 17

Original Poster
Rep: Reputation: 0
I found "a" fix. This little bit in the standard .bashrc file


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

was blocking the rest of the file to be executed. If I comment it out, I get the behavior I want. There are probably some security issues with doing it like this but it will have to do for now.

- Andri
 
  


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
Environmental variables... permanent fabianrios Fedora 2 10-20-2005 05:06 PM
Environmental Variables danglingpointer Slackware 13 01-06-2005 12:36 AM
environmental variables msound Programming 0 08-21-2004 07:06 PM
environmental variables? blackzone Linux - General 1 08-06-2004 03:44 AM
environmental variables mbhenry Linux - General 6 09-18-2003 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:42 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration