- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ssh sets up environment variables differently
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 09:30 AM
тАО06-06-2006 09:30 AM
ssh oracle@host lsnrctl stop
ksh: lsnrctl: not found
ssh oracle@host
host# lsnrctl stop
LSNRCTL for HPUX: Version 9.2.0.7.0 - Production on 06-JUN-2006 14:23:53
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=BWD.WORLD))
The command completed successfully
ssh oracle@host "env | grep PATH"
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/ssh/bin
ssh oracle@host
host# env | grep PATH
PATH=/oracle/SID/920_64/bin:/usr/sap/SID/SYS/exe/run:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/opt/resmon/bin:/opt/gnome/bin:/opt/perf/bin:/opt/ignite/bin:/opt/mozilla:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/prm/bin:/usr/sbin/diag/contrib:/opt/mx/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/hpnpl//bin:
why are they different and what variable in which configuration file controls this difference.
Thanks for all the responses in advance
UNIX because I majored in cryptology...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 09:40 AM
тАО06-06-2006 09:40 AM
Re: ssh sets up environment variables differently
Instead make a command file to do the shutdown, and put the environment variables in the command script file.
E.g.
#!/bin/ksh
# listener shutdown for MYDB
#
ORACLE_HOME=/u1/oracle/MYDB/9.2.0
TNS_ADMIN=${ORACLE_HOME}/network/admin
PATH=${PATH}:${ORACLE_HOME}/bin
export ORACLE_HOME TNS_ADMIN
lsnrctl stop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 09:56 AM
тАО06-06-2006 09:56 AM
Re: ssh sets up environment variables differently
See man sshd_config and man ssh.
-Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 10:01 AM
тАО06-06-2006 10:01 AM
Re: ssh sets up environment variables differently
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 10:14 AM
тАО06-06-2006 10:14 AM
Re: ssh sets up environment variables differently
Thanks for the suggestion but the remote account as you can guess belongs to the dba's and I do not want to make any changes as they can break something and I do not like to be at the target end of a pointing finger.
Paul,
Due to pretty much the same thing above, I do not want to mess with their account settings.
All in all, I want the ssh session having the same environments regarless I am in an iteractive session or remote command execution mode. Can this be accomplished without creating new files or changing the environment variables related to oracle ?
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 10:22 AM
тАО06-06-2006 10:22 AM
Solutionssh
The single quotes pass everything over to the remote system and the multiple commands will emulate a login shell environment.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2006 10:25 AM
тАО06-06-2006 10:25 AM
Re: ssh sets up environment variables differently
See man sshd under "Login Process". The basic environment it sets up is determined at compile time, then it sets up what is in $HOME/.ssh/environment. The last step is "Runs user's shell OR command".
-Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2007 08:55 PM
тАО01-30-2007 08:55 PM
Re: ssh sets up environment variables differently
After spend 3 hours, finally got your post.
Now my command works like
ssh -q -o 'StrictHostKeyChecking no' -o 'BatchMode yes' oracle@$v -i /home/oracle/.ssh/open-key '. /etc/profile;. /home/oracle/.profile;sqlplus -V' >> $LOGFILE
Hahahahaha! Excellent! Thank you Bill!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2007 02:13 AM
тАО04-24-2007 02:13 AM
Re: ssh sets up environment variables differently
UNIX because I majored in cryptology...