0

Need a help in adding an entry to the AIX inittab on VIO server. The VIO server is a restricted shell, to add entry to the inittab we need to access the root shell using command: oem_setup_env. I'm trying to add the below entry using SSH from Jump Server to the VIO server. The entry doesn't get added to inittab file.

ssh -q aixlpar122 "ssh -q padmin@vio01 print "\mkitab \"splunk:2:once:/usr/bin/startsrc\ -g\ splunk\ \>\ \/dev\/console\ 2\>\&1\ "  | oem_setup_env "

Getting below error :

rksh: /dev/console: 0403-019 The operation is not allowed in a restricted shell.
1

Extending Stéphane's idea from a previous answer:

ssh -q aixlpar122 ssh -q padmin@vio01 oem_setup_env << 'EOF'
mkitab "splunk:2:once:/usr/bin/startsrc -g splunk > /dev/console 2>&1"
EOF

This:

  1. starts an ssh session to aixlpar122 with a single command (another ssh) whose input is redirected from the here-document given at the end.
  2. the second ssh session to padmin@vio01 starts a single command (oem_setup_env) who will receive (consume) commands from stdin.
  3. the here-document sends the normally-quoted mkitab command along the ssh chain.

Hopefully the Splunk you have is the Splunk from the VIOS Recognized Solutions page and that your inittab entry isn't clobbered by future VIOS upgrades!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.