Sponsored Content
Full Discussion: ssh & load custom profile
Top Forums UNIX for Advanced & Expert Users ssh & load custom profile Post 302696891 by jim mcnamara on Wednesday 5th of September 2012 03:19:55 PM
Old 09-05-2012
You need either a list of user id's (numeric) or group ids (numeric) on the remote box. The example uses group ids

Call it /path/to/id.txt. I am assuming a POSIX compliant system
Code:
[ "$(awk -v me=$(id -g) 'me==$0 {print 1}' /path/to/id .txt )" ]  && source /path/to/.jack_profile

On the remote box:

Add the above line in a common file /etc/profile or add it to some other globally executed login script. Be sure to test first before placing it in "login" files.

Note: "source" works only with bash, you can use a lonely leading dot instead.

You can modify .jack_profile to do the same check and just simply put it in some global file. All you do to maintain it is edit the /path/ti/id.txt file.
 

7 More Discussions You Might Find Interesting

1. 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

2. UNIX for Dummies Questions & Answers

create and load my own .profile

Hello to everyone, This is my first that I use any group in order to find a reply to my question. I would really like your help!!! Do you know how can I create my own .profile file in unix (not edit the existing one) and how can I load it when i open a new bash? I would like those settings... (1 Reply)
Discussion started by: unbalanced
1 Replies

3. UNIX for Advanced & Expert Users

How can I get sudo -u <username> to load that users profile on HP-UX

I am running a serverapplication on a HP-UX machine where I need to handle some of the commands as a specified user called "druser". When I log on as this user with the command; sudo -u druser -sit starts an instance of the shell as that user. However, it doesn't load that users .profile from... (1 Reply)
Discussion started by: ukiome
1 Replies

4. UNIX for Dummies Questions & Answers

Permit sftp load /etc/profile on AIX6.1

Hi, I've set on /etc/profile: TMOUT=3600 readonly TMOUT It seems to work when I connect using ssh client, putty for example, but not when connect through sftp. What am I missing on sshd configuration? regards Israel. (2 Replies)
Discussion started by: iga3725
2 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. Ubuntu

Load Balancing - LB Server & BackEnd1 & BackEnd2

Hello, What I wish to succeed is to setup loadbalancing between two dedicated servers. Here is my case: ======================================================================================================= LB IP (Just an IP address): Provided by hosting company (11.22.33.44) Hosting company... (1 Reply)
Discussion started by: baris35
1 Replies

7. Programming

Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag.... I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard. So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies
asadmin-delete-custom-resource(1AS)				   User Commands			       asadmin-delete-custom-resource(1AS)

NAME
asadmin-delete-custom-resource, delete-custom-resource - removes the custom resource SYNOPSIS
delete-custom-resource --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile file- name] [--terse=false] [--echo=false] [--interactive=true] jndi_name Removes the custom resource. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. OPERANDS
jndi_name JNDI name of the custom resource to be deleted. Example 1: Using delete-custom-resource asadmin> delete-custom-resource --user admin1 --password adminadmin1 --host pigeon --port 5001 sample_custom_resource Command delete-custom-resource executed successfully Where sample_custom_resource is the custom resource deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-custom-resource(1AS), asadmin-list-custom-resources(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-custom-resource(1AS)
All times are GMT -4. The time now is 08:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy