79784759

Date: 2025-10-07 16:38:16
Score: 1
Natty:
Report link

The error is explained in this Support page of IBM:
https://www.ibm.com/support/pages/unable-execute-commands-remotely-vio-server-padmin-user-ssh

Quote:

Question
Remote command execution by padmin user via ssh fails with not found error.
Answer
1) Example of remote command execution failing from a SSH client to the padmin user on a VIO server.
SSH Client:

# ssh padmin@<VIO server> ioscli ioslevel
rksh: ioscli: not found

# ssh padmin@<VIO server> ioscli lslparinfo
rksh: ioscli: not found

To allow remote command execution by padmin on VIOS do the following:
2) Get to the root prompt on the VIO server.
$ whoami
padmin

$ oem_setup_env
#

3) Link /usr/ios/cli/environment to /home/padmin/.ssh/environment.
# cat /usr/ios/cli/environment
PATH=/usr/ios/cli:/usr/ios/utils:/usr/ios/lpm/bin:/usr/ios/oem:/usr/ios/ldw/bin:$HOME

# ls -l /home/padmin/.ssh/environment (Link is not there).
/home/padmin/.ssh/environment not found

# cd /home/padmin/.ssh
# ln -s /usr/ios/cli/environment environment
lrwxrwxrwx 1 root system 24 Dec 19 08:28 /home/padmin/.ssh/environment -> /usr/ios/cli/environment

# ls -l /home/padmin/.ssh/environment
lrwxrwxrwx 1 root system 24 Dec 19 08:28 /home/padmin/.ssh/environment -> /usr/ios/cli/environment

4) Edit /etc/ssh/sshd_config. Uncomment the PermitUserEnvironment directive and change from it's default of no to yes.
# vi /etc/ssh/sshd_config

Change from:
#PermitUserEnvironment no

Change to:
PermitUserEnvironment yes

5) Stop and restart sshd
# stopsrc -s sshd
# startsrc -s sshd

6) Test ssh remote command execution from SSH client to VIO server as the padmin user.
# ssh padmin@<VIO server> ioscli ioslevel
2.2.2.1

# ssh padmin@<VIO server> ioscli lslparinfo
1 VIO-Server-1
Successfully executed remote command as padmin user via ssh.

NOTE-1: You can also configure SSH public/private keys between a SSH client and the VIO server for the padmin user to avoid having to supply the padmin password for each command execution.

NOTE-2: From sshd man page:
PermitUserEnvironment
Specifies whether ~/.ssh/environment and environment= options in ~/.ssh/authorized_keys are processed by sshd(8). The default is ''no''. Enabling environment processing may enable users to bypass access restrictions in some configurations using mechanisms such as LD_PRELOAD.
Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Steve