cancel
Showing results for 
Search instead for 
Did you mean: 

Adding SAP commands to user shell

omar_moh_ibrahim
Explorer
0 Kudos

Hello ,
I'am trying to install SAPROUTER on a standalone linux server , before contacting SAP to register new SAPROUTER i want to make sure that SAP commands are executable .

I have successfully set the user environment variables :

SECUDIR="/usr/sap/saprouter"
LD_LIBRARY_PATH="/usr/sap/saprouter"
SNC_LIB="/usr/sap/saprouter/libsapcrypto.so"

i'm trying to use SAP commands such as SAPGENSE but the O.S still can't identify theses commands .

Please inform me how to add SAP commands to user shells in linux .

Accepted Solutions (1)

Accepted Solutions (1)

Hello Omar,

the commands are looked up based on the PATH environment variable. If you want to execute the saprouter (and related commands) without a full path, you need to add their location to the PATH.

omar_moh_ibrahim
Explorer
0 Kudos

Hello Adam ,

Thanks alot for your reply ,

do you mean i have to set the environment variable on the PATH in .bash_profile user file like the following syntax

PATH=$PATH:$HOME/bin (Default PATH)

PATH$PATH:/usr/sap/saprouter ( suggested modification )

Thanks in advance .

Yes, you would need to add the /usr/sap/saprouter to the PATH variable.

You can do it in bash (with the .bash_profile) as:

export PATH=$PATH:/usr/sap/saprouter

omar_moh_ibrahim
Explorer
0 Kudos

Alright Adam , i exported the PATH exactly as you wrote and rebooted the system , but still system cannot identify SAP commands here is the output of .bash_profile file inform me if there is any syntax errors or missing items :

# .bash_profile #

Get the aliases and functions

if [ -f ~/.bashrc ]; then . ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH=$PATH:/usr/sap/saprouter

0 Kudos

That looks ok so far. What do you see when you check the variable after logging in with the user?

ie: check with the "env" command, or "echo $PATH"

omar_moh_ibrahim
Explorer
0 Kudos

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/sap/saprouter:/root/bin:/usr/sap/saprouter

omar_moh_ibrahim
Explorer
0 Kudos

Thanks Adam for your time issue finally resolved .

Answers (2)

Answers (2)

isaias_freitas
Advisor
Advisor

Hello Omar,

The sapgenpse executable is not delivered with the saprouter SAR packages.

Did you also download the SAPCryptoLib / SAPCommonCryptoLib SAR file? If yes, have you extracted it to the "/usr/sap/saprouter" folder too?

Regards,

Isaías

omar_moh_ibrahim
Explorer
0 Kudos

Hello Isaias ,

Yes i have downloaded the SAPCryptoLib and SAPCommon and extracted them to the directory /usr/sap/saprouter and here is it's contents for certainty :
libsapcrypto.so libslcryptokernel.so libslcryptokernel.so.sha256 niping patches.mf sapcrypto.lst sapcrypto.mf sapgenpse saprouter SIGNATURE.SMF

and kindly be notified that i'm not able to use sapgense command only , it's all of the SAP commands sapgense, saprouter ,...

Thanks in advance

isaias_freitas
Advisor
Advisor

Hi!

What happens if you execute "/usr/sap/saprouter/sapgenpse" (I mean, using the complete path)?

Does it work?

Regards,

Isaías

omar_moh_ibrahim
Explorer
0 Kudos

well well ..
it worked now , seems to be i have to execute the full path of the new commands first for the system to be able to identify it .
I'm very obliged Isaias you really gave me crucial hint now made me able to solve this dilemma !!!
here is the output :
Usage: sapgenpse [-fips on/off] [-h] [-l <sapcryptoPath>] <command> [-h] [sub-options] ... -l <sapcryptoPath> Path of CommonCryptoLib (libsapcrypto.so) to be used -h Show help text -fips on/off Activate FIPS 140-2 mode <command> Command to execute <command> -h Show help text of named command All commands that create PSEs or Credentials support the option -lps. (These commands are gen_pse, import_p12, import_p8, keytab, seclogin) The -lps option enables the usage of the Local Protection Storage (LPS) to protect the sensitive information stored in PSEs and Credentials. An LPS protected PSE or credential could only be used on the same system where it has been created. The LPS uses one of the following mechanisms to protect the data: - (DP ) The Microsoft Data Protection API, on Windows only - (TPM) Trusted Platform Module (TPM), on Linux systems with an installed TPM - (INT) Internal protection mechanisms, on all other systems It is strongly recommended to use LPS to protect all PSEs and Credentials. The command lps_enable can be used to enable LPS on existing PSEs. The command seclogin can be used to enable LPS on existing credentials. Loaded CommonCryptoLib from sapgenpse folder "/usr/sap/saprouter/libsapcrypto.so" Platform: linux-gcc-4.3-x86-64 (linux-gcc-4.3-x86-64) Versions: SAPGENPSE 8.5.19 (Jan 29 2018) CommonCryptoLib 8.5.19 (Jan 29 2018) [AES-NI,CLMUL,SSE3,SSSE3] Build change list: 233843 USER="root" Environment variable $SECUDIR is defined: "/usr/sap/saprouter"


Once again thanks a lot Isaias for your time and concern .

isaias_freitas
Advisor
Advisor
0 Kudos

You are welcome!

If it worked when using the full path, but still does not work without it, then for sure it is something with the environment variable PATH.

Cheers!

Isaías

omar_moh_ibrahim
Explorer
0 Kudos

No just the first time needed the full path .Afterwards , the O.S identified other commands such as SAPROUTER just when i type SAP then pressing tab button the system shows all commands starting with SAP.

isaias_freitas
Advisor
Advisor
0 Kudos

Then I'm not sure of what happened :-).

nelis
Active Contributor
Please inform me how to add SAP commands to user shells in linux .

For all users you can add the commands to /etc/profile.local

eg. SECUDIR=/usr/sap/saprouter/sec; export SECUDIR (bash shell)

Or for individual users simply add the above command to .bashrc in your home directory(shell dependant).