So, I have this script that makes a call to ifconfig to pull the interface information and report it. When I log on to the machine the script works just fine. But, if I'm on a remote machine and I make a call like this.
ssh user@server ./script.bash
I get an error saying that the IFCONFIG command is unavailable. No idea why.
Everything is being run as a user. Naturally, root ssh is disabled.
./sysinfo.bash: line 30: ifconfig: command not found
I also got the same error when I supplied the full path. I'd supply the script, but it's it's on a seperate network and I can't transfer the script to public domain.
The full path is /usr/sbin/ifconfig. And it runs fine if I do an actual login.
Yes, I did. I modified the script on the remote machine to point to /usr/sbin/ifconfig which is where it's located. I don't have whereis so I used which. Which is pretty much the same. It's Solaris 10 on a sparc Netra-T5220.
Older Solaris releases used to provide two different ifconfig binaries, one in /sbin and the other in /usr/sbin, with a slightly different behavior regarding the name service resolution order.
Recent releases have /usr/sbin/ifconfig being just a symbolic link to /sbin/ifconfig.
If you get an error message, please post the exact command you typed, what you expected to happen, and the exact error message you received. Accuracy is so important in computing.
First impression:
The ifconfig command is in lower carriage. Unlike Microsoft platforms, you cannot type unix commands in the wrong case. If you typed IFCONFIG , it will fail.
Assuming you typed the command correctly, what user are you using? i.e. Is it not root?