How to invoke user env. on remote server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to invoke user env. on remote server
# 1  
Old 02-11-2011
How to invoke user env. on remote server

I am tryying to ssh remote machine from a script to run a program for a particular user but it is not bringing up the user environment on remote machine. I was wondering if some one tells me what is the command I should put in the script which will invoke user env on the remote server before ssh is executed. I tried . ${HOME}/.profile but did not work.

Thanks
# 2  
Old 02-11-2011
is there a file in which all the user env are stores or you want to load PATH variable.

Please expand a bit on your problem statement and on which command you are not able to execute
# 3  
Old 02-11-2011
SSH works fine on command line but when i use same ssh -t ... command in a script , it complains about the "variable not defined" on the remote machine. It is not bringing up the remote environment for the user when invoked ssh within script.So what should I use in the script , so that user environment is invoked before ssh is executed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Shell Programming and Scripting

Invoke scripts in different UNIX env

Hi, Problem Statement: We have 400 shell scripts to be tested and they run over 4-5 different unix environments. All these are run in SUDO mode. My requirement is to Define aliases for each script which accepts the Date & Order ID as a parameter so that I can submit all these scripts from 1... (4 Replies)
Discussion started by: Chiranjeeva
4 Replies

4. Shell Programming and Scripting

How to give user name and password in a single command to login to remote server

Hello All, I'm new to unix and i need the below favour from you. I have list of 50 unix server. I need to login to all the server one by one and with the same user and password. I will declare the user name and password globally in the script. for example : servername- hyperV user name... (4 Replies)
Discussion started by: Hari A
4 Replies

5. UNIX and Linux Applications

invoke remote graphical application..and display locally

Hi, I want to invoke(run) a graphical application remotely, and the display should be in remote itself. (no X redirect).i want to do this through ssh. like if i login to a remote machine and run firefox it should display there itself. how can i do this..? (2 Replies)
Discussion started by: madhusudankh
2 Replies

6. Shell Programming and Scripting

[SSH] Need to connect to remote server as different user and without password

I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password. If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
Discussion started by: Totengraber
3 Replies

7. Solaris

How to invoke remote java program from ssh

How can i invoke java program from MC1, when I connect remotely to execute can I set classpath etc. ____________ <-------------->____________________ |..................|<-------------->|...............................| |..................|<-------------->|...............................|... (2 Replies)
Discussion started by: vishnu559
2 Replies

8. AIX

How can invoke applications on Windows machine from AIX server

Hi folks, Before I start explaning my problem let me tell you I am new to Unix environment. I am working on a application. It was developed in java (on Windows machine). But application for production will be deployed on AIX machine. One of my requirement is I need to invoke QTP scripts and... (3 Replies)
Discussion started by: sachinrt
3 Replies

9. Solaris

To invoke a script on a remote machine

Hi, I am trying the following- 1. ftp a file from machine1 to machine2. 2. Once the ftp is done, from machine1 invoke a shell script on machine2. Could anyone please help me on this? (5 Replies)
Discussion started by: sam_roy
5 Replies

10. AIX

Do I need to remote after installation of s/w and set the env variable

Hi, I have installed ODWEK software on AIX box and set the environment variables like: PATH,LIBPATH,LD_LIBRARY_PATH,CLASSPATH. My question here is do I need to reboot the system to take these changes or is there anyother workaround. I heard that there is 'export'. But I don't know how far it... (1 Reply)
Discussion started by: srangu
1 Replies
Login or Register to Ask a Question