Results 1 to 1 of 1
- 07-24-2013, 01:17 PM #1Member
- Join Date
- Jul 2013
- Rep Power
SSH Remote connection with Environment Variables
I am writing a java code to connect to the Unix remote server using java-ganymed plugin (also tried with JSch).
Connection conn = new Connection("host"); conn.connect(); boolean testAuth = conn.authenticateWithPassword("user", "pwd"); Session sess = conn.openSession(); sess.execCommand(Commands); //"Commands" is a string variable with "sh" command.
I tried running /etc/profile, .bashrc etc prior to my script. The script moves one step ahead but again halts. So its evident that a few environment variables were loaded but not all. I need a work around to ensure all the environment variables are loaded for the Java non-interactive session. I do NOT have the root permission for the remote server.
- By freelance84 in forum New To JavaReplies: 9Last Post: 07-21-2011, 09:12 PM
- By Terra in forum New To JavaReplies: 9Last Post: 07-07-2011, 05:28 AM
- By elizabeth in forum Advanced JavaReplies: 4Last Post: 08-02-2007, 04:53 AM