Remote ssh execution and .profile issues


 
Thread Tools Search this Thread
Operating Systems HP-UX Remote ssh execution and .profile issues
# 1  
Old 07-12-2012
Remote ssh execution and .profile issues

Greetings, i'm currently having issues in successfully executing a script from one server to other, and i'm cracking my nut in understanding why. Let's get started with the default info:
Code:
Server A:
briozzo@A:/home/briozzo $ uname -a
HP-UX A B.11.31 U ia64 2787251109 unlimited-user license

briozzo@A:/home/briozzo $ sudo -V
Sudo version 1.6.8p12

Server B:
briozzo@B:/bilala/data001/scripts $ uname -a
HP-UX B B.11.11 U 9000/800 3196149708 unlimited-user license

briozzo@uxwspr78:/bilala/data001/scripts $ sudo -V
Sudo version 1.6.6

----------------------------------------
So, i've setup ssh keys and will be able to execute commands from Server A to Server B:
Code:
ssh briozzo@B hostname
B

Now, in server B there's a script (IBM Cognos related) that i will normally manually execute with my user and it will work without issues. But when i try to remotelly execute from server A, that's when the problems begin:
Code:
briozzo@A:/home/briozzo $ ssh briozzo@B SCRIPT
Beginning Cube Build
/usr/lib/dld.sl: Can't find path for shared library: libxerces-c1_5_2_7_4_0.sl
/usr/lib/dld.sl: No such file or directory
/bilala/data001/scripts/build_c10_cro_is_cube.test[10]: 22079 Abort(coredump)

When i first found this error on server B, it was due lack of a variable declaration, i set that variable on B's .profile and it solved itself.

Questions then arise:
1) When doing ssh user@server command , do you inherit the previous user env variables or are the user@server ones loaded when executing the command?
2) If the inherit option is true, then i have already tried to mirror the same .profile in both servers, won't work (get the shared library path error). Do i need to declare something else here?
3) If .profile is loaded at the time of remote login, then why am i getting this error?

I'm trying both to understand the big picture and solve the issue, so any inputs will be apreciated.

Regards

Moderator's Comments:
Mod Comment Please view this code tag video for how to use code tags when posting code and data.

Last edited by vbe; 07-12-2012 at 08:45 AM..
# 2  
Old 07-12-2012
If I recall:
1) I dont think you read .profile when executing only a command, same behaviour as on local when you use su... (diff between su <user> command and su - <user> command...) there is maybe an option though (so far I was not concerned...)
2) I dont get the point:
if
Quote:
When i first found this error on server B, it was due lack of a variable declaration, i set that variable on B's .profile and it solved itself.
3) Does it work when you remote login using ssh and copied .profile and execute things?
If not, the solution is in the post I just erased (damn...)

Last edited by vbe; 07-12-2012 at 09:07 AM.. Reason: typos (cant believe it its not friday yet!)
# 3  
Old 07-12-2012
2) Basically: I copied .profile from server B to A, and tried to execute the script from A to B. Will get that error again.

So, i should create a 'enviroment' file on my .ssh directory? What should i declare there?
# 4  
Old 07-12-2012
Sorry for not being reactive enough, I see to have some strange network issues...
Quote:
2) Basically: I copied .profile from server B to A, and tried to execute the script from A to B. Will get that error again.
OK but then what did you mean here:
Quote:
When i first found this error on server B, it was due lack of a variable declaration, i set that variable on B's .profile and it solved itself.
Either it solved (question of reading .profile) or it did not ( ssh needs more to read .profile), have a look at the ssh_config man pages!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remote script over ssh execution issues.

If I execute below code I am able to get string from column8 and column10 about a process. serverA1$> ps -ef | grep rotate | grep 'config' | awk '{print $8" "$10}' /<Oracle_home>/ohs/bin/odl_rotatelogs -h:/<app_Home>/config/OHS/ohs1/component_events.xml_ohs1... (12 Replies)
Discussion started by: kchinnam
12 Replies

2. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies

3. Shell Programming and Scripting

Shell Script execution issues

Hi, There's a shell script by name "download", which has been created as user "mgr" and that script needs to executed as user "dev". I tried giving privileges 701 on the script download. But it's throwing the error message bin]$ ./download /bin/bash: ./download: Permission denied ... (6 Replies)
Discussion started by: venkatesh17
6 Replies

4. Cybersecurity

Log remote execution over SSH

If a user execute commands remotely over ssh : $ ssh USERNAME@SERVER COMMANDSHow the SERVER administrator can log those COMMANDS executed in a "not a tty" session ? I searched for my question and get the following suggestions:Anybody give help how to do this ? what the content of "/bin/bash "... (1 Reply)
Discussion started by: new0h
1 Replies

5. AIX

SSH and a users .profile

How do I get a command like "ssh Theuser@host date" to execute the /home/Theuser/.profile before executing the "date" command? (5 Replies)
Discussion started by: IL-Malti
5 Replies

6. Solaris

how to login with ssh to remote system with out applying the remote root/usr password

how to login with ssh to remote system with out applying the remote root/user password with rlogin we can ujse .rhosts file but with ssh howits possible plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

7. Shell Programming and Scripting

ssh can't back from remote host during script execution

Hi all I wrote a script to execute a script on several remote hosts, but somehow during the execution of the local script, ssh can't come back from the remote host, so that causes my local script hanging... I use the below command to do the job in the local script, any idea? ssh... (12 Replies)
Discussion started by: bzylg
12 Replies

8. UNIX for Dummies Questions & Answers

Profile execution issue

Hi I have a profile execution issue, I log on to a linux machine , then i do sudo to another user as sudo su - <username> , then <username> .profile executes properly but when I type something I loose all environment varaible and my prompt changes to '$' loosing the PS1 value that I have... (1 Reply)
Discussion started by: malavm
1 Replies

9. Shell Programming and Scripting

Issues using ssh from crontab to run remote script from

I have a solaris9 x86 server using ssh as follows: SSH Version Sun_SSH_1.0, protocol versions 1.5/2.0. The remote server solaris9 sparc has exactly the same version ssh installed. I am running a script on my server which includes the following command to run a script on the remote server:... (4 Replies)
Discussion started by: frustrated1
4 Replies

10. UNIX for Advanced & Expert Users

executing .profile with ssh

Hi, How do I get all my profile settings when connecting with ssh? (5 Replies)
Discussion started by: rein
5 Replies
Login or Register to Ask a Question