How to set PATH variable for all HP-UX users when they login using ssh?


 
Thread Tools Search this Thread
Operating Systems HP-UX How to set PATH variable for all HP-UX users when they login using ssh?
# 1  
Old 02-07-2014
How to set PATH variable for all HP-UX users when they login using ssh?

Hello friends,

I need to set PATH variable for all HP-UX users. I tried to implement it using /etc/profile and /etc/sshrc both none of them work.

I don't see sshrc file anywhere.

Please advise!
TIA
# 2  
Old 02-07-2014
/etc/profile is a script file, what's in it and what you did to it may be relevant.

Changes would not be seen until they logout and log back in.

Also, depending on how they login, /etc/profile and other normal login files may not be used. What are they doing?
# 3  
Old 02-07-2014
Thank you Corona688,

I did logout and login again. Users login using ssh (as I mentioned in subject line) to login.

It is working on other OS's (I used /etc/profile many times on Solaris) but not working on HP-UX (this is first time I'm doing) . Just wondering if I need to enable anything so that it gets run when users login?
# 4  
Old 02-07-2014
Logging in how? just 'ssh username@host' or 'ssh username@host command-to-run'? The latter bypasses logins.

Also, what is their shell? If they use csh/tcsh, that's not actually a Bourne shell and cannot use the standard /etc/profile, since that's a Bourne shell script. It has its own special ones.

Last edited by Corona688; 02-07-2014 at 03:40 PM..
# 5  
Old 02-10-2014
in your .ssh directory, create a file called environment...
Here is mine:
Code:
ant:/home/vbe/.ssh $ ll env*;more environment
-rw-rw-r--   1 vbe        bin            193 Jun  7  2013 environment
# Set up the shell environment:
        TMOUT=0
# Set up the shell variables:
        EDITOR=vi

        #ENV=$HOME/.kshrc
        ENV=$HOME/.profile
HISTFILE=$HOME/.sh_history
#HISTSIZE=18432

The file should contain only variables, anything else will void its usage...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Expect /bash, 2 ssh login users

HI all i need to connect to about 900 cisco routers and switch to do some configs changes. the issue i am having is that half the devices have one set of username and password and the other half have another username and password. From expect or bash script i can ssh into a device and make... (1 Reply)
Discussion started by: quintin
1 Replies

2. Shell Programming and Scripting

Unable to set my PATH variable

Hello All, Hope you can understand my problem from the below code. $ cat ~/.profile PS1=`whoami`@`hostname`':$PWD $ ' export PATH="$PATH:.:/logarchive/utility/util:/usr/sbin:" $ echo $PATH /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:.:/usr/sbin: $ echo $SHELL /usr/bin/ksh ... (6 Replies)
Discussion started by: sathyaonnuix
6 Replies

3. Red Hat

RHEL: Users unable to login via SSH

removing the post (6 Replies)
Discussion started by: titanic4u
6 Replies

4. UNIX for Dummies Questions & Answers

$USER is not set in remsh but works fine via ssh login

1) ssh a@b echo $USER it display the correct value as a (even though i have not defined it in .profile) 2) remsh b -l a echo $USER it does not display the value as a (variable is not set any idea why $USER variable is not initialized when i login via remsh or rlogin but shows the... (10 Replies)
Discussion started by: reldb
10 Replies

5. UNIX for Dummies Questions & Answers

PATH variable set incorrectly?

I've noted that in order to use commands like ifconfig, I have to prefix the commands with the directory. /etc/profile shows that the paths should be part of the PATH environment variable; any idea where the bug is? :confused: # /etc/profile # System wide environment and startup... (1 Reply)
Discussion started by: jon80
1 Replies

6. AIX

Not able to login as normal users through console /telnet/ssh

Hi , I am having problem,users are not able to login through ssh or telnet.Only we can login as root user in console. Restarted telnet and sshd ,no luck. Any ideas. AIX -- 5.2 ML 07 Thanks, MNK (1 Reply)
Discussion started by: mnkfre
1 Replies

7. AIX

How to set path for the EDITOR variable?

For some reason something has changing in my AIX environment where when I type: ACLEDIT filename ...I get: 3002-104 acledit: EDITOR environment variable must be full pathname I know I need to reset the EDITOR variables path to /usr/bin/vi but I can't remember the syntax anyone? (2 Replies)
Discussion started by: heprox
2 Replies

8. UNIX for Dummies Questions & Answers

set variable PATH

Hi, i know that this topic discussed for many times but although i had researched them i couldnt succeed in my problem. i am following a step-by-step instruction guide and must do the following: ------------- To ensure access, set the path PATH $ORACLE_HOME/perl/bin:$PATH and set the Perl... (2 Replies)
Discussion started by: merope
2 Replies

9. UNIX for Advanced & Expert Users

set path so all new users can execute the command in /bin/mycommands

I want to add a default path /bin/mycommands along with others to be loaded as default path for all new accounts created on my system . With out the new accounts not having to change thie manually to /bin/mycommands.Do I change the /etc/profile ? is there any better way? Please throw some... (2 Replies)
Discussion started by: sravusa
2 Replies

10. Shell Programming and Scripting

Set Path variable in c shell

I set my path environment variable in c shell, using the syntax below setenv PATH "${PATH}:/usr/local:/usr/local/bin" and placed this in $HOME/.login $HOME/.cshrc and /etc/.login /etc/.cshrc but when I issued echo $PATH or set command the output does not reflect changes made to... (5 Replies)
Discussion started by: hassan2
5 Replies
Login or Register to Ask a Question