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 11-17-2007, 04:27 AM   #1
jamesstanley
LQ Newbie
 
Registered: Oct 2007
Location: Cheltenham
Distribution: Debian, plan to switch to compiling everything
Posts: 6

Rep: Reputation: 0
[SSH]Which login scripts are run?


Long Description
I am trying to set up an MPICH2 beowulf cluster, just for fun.
I have got mpd to run processes on localhost, and I have setup passwordless SSH login.
My problem is that when mpdboot tries to execute mpd's on the other host (only one other until I can get it working ), it fails because /usr/mpich/bin is not in the path.

Short Description
Which login scripts are run when SSH logs in, without bash being executed? I know some must be because...
Code:
ssh 192.168.1.102 'echo $PATH'
has an output.
 
Old 11-17-2007, 05:23 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,485
Blog Entries: 54

Rep: Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902
Quote:
Originally Posted by jamesstanley View Post
Which login scripts are run when SSH logs in, without bash being executed?
An elaborate way would be to add echoes to your global and the accounts resource scripts and you'll see soon enough what gets sourced. A less elaborate way would be to 'man ssh', check under "Login session and remote execution". And what do you mean "without BASH being executed"? Did you doctor the account so it has no shell or what?


Quote:
Originally Posted by jamesstanley View Post
My problem is that when mpdboot tries to execute mpd's on the other host (only one other until I can get it working ), it fails because /usr/mpich/bin is not in the path.
Can't you just use the full path if you don't want to add /usr/mpich to your PATH?

Last edited by unSpawn; 11-17-2007 at 05:25 AM.
 
Old 11-17-2007, 05:37 AM   #3
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
When You do
Quote:
$ ssh 192.168.1.102 'echo $PATH'
you will have "broadly speaking" the environment of the calling user.

When You do
Quote:
$ ssh 192.168.1.102
$ echo $PATH
you will have the environment of the remote user.

I am not all together certain to what extent a ssh-session read profile, .bashrc etc when logging in but You can set some of it in /etc/ssh/ssh_config (or something similar). Ssh also set a few environment variables by default but You can specify more of 'em in ~/.ssh/environment.

/L
 
Old 11-17-2007, 06:24 AM   #4
jamesstanley
LQ Newbie
 
Registered: Oct 2007
Location: Cheltenham
Distribution: Debian, plan to switch to compiling everything
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
An elaborate way would be to add echoes to your global and the accounts resource scripts and you'll see soon enough what gets sourced
I tried that in:
~/.bashrc
~/.bash_profile
~/.bash_login
~/.profile
/etc/bashrc
/etc/profile

Nothing got echoed.

Quote:
you will have "broadly speaking" the environment of the calling user.
I had /usr/mpich/bin in the path of the calling user, but not the SSH session (same user, same host).

Quote:
Can't you just use the full path if you don't want to add /usr/mpich to your PATH?
It's not hat I want it in the path, it's that mpich won't work without it in the path. I suppose I could edit the mpdboot script, but it would be nicer to do it the right way.

I'm going to check the man page now.

EDIT:
Ah.
~/.ssh/rc is the file I want.

Last edited by jamesstanley; 11-17-2007 at 08:27 AM.
 
  


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
Using SSH in Shell Scripts GNUsavior Programming 19 04-24-2006 09:30 PM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 10:59 AM
problems with ssh in scripts wedgeworth Linux - Software 8 10-01-2003 08:02 AM
ssh using shell scripts Alek Linux - Networking 4 09-05-2003 01:28 PM
SSH using shell scripts Alek Linux - General 2 08-28-2003 02:52 PM


All times are GMT -5. The time now is 02:19 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