What's new

Release PATH not being set in SSH sessions

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

wessty1984

Occasional Visitor
Currently running 388.2_2 on an RT-AX88U and I've been having a weird issue where no commands work in an SSH session unless I input the command below.

PATH="/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/admin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"

Wondering what should be setting PATH and if anyone has ideas as to why it isn't being set properly. Thanks all for taking a look at this, it's not a major issue since I can manually set PATH but would like to try and fix it the right way if I can.

Everything does work fine for a short period of time after a reboot on the router so it does have it properly defined at least for a bit, not sure if that information helps. Also once it is lost I have to set it every time, when I exit the SSH session it is again not defined when I re-establish an SSH session.
 
Last edited:
Look for these files and check if they exist and include any PATH statements.
Code:
grep -H PATH /jffs/etc/profile /opt/etc/profile /jffs/configs/profile.add
 
Thanks for the reply, here is the output of the above command. I don't think I see anything actually setting it just those checks which probably aren't doing anything with PATH undefined. I'm assuming that /jffs/etc/profile directory is supposed to exist but could be wrong on that.

1689162259025.png
 
What packages have you installed from Entware? Anything related to bash or busybox? PATH should be set from /etc/profile normally.
 
I don't believe so, I pretty much only install packages through AMTM I wouldn't trust myself to install anything more advanced than that. Below should be everything installed.

1689163419081.png
 
Login a new session and run these commands just to get a clear sense of what happens.
Bash:
cat /etc/profile; echo "+++++++++"; cat /opt/etc/profile
echo $PATH
 
That’s totally screwed up. Try unmounting the USB and test again. If it’s still bad, I’d reset to defaults, or suspect some malware.
 
Thinking I might also first try replacing the USB flash drive, take advantage of the Prime Day deals. Thinking it's possible something isn't entirely right with the flash drive itself.
 
Thinking I might also first try replacing the USB flash drive, take advantage of the Prime Day deals. Thinking it's possible something isn't entirely right with the flash drive itself.
Just remove it temporarily to eliminate Entware and test a login. You can always put it back.
 
Currently running 388.2_2 on an RT-AX88U and I've been having a weird issue where no commands work in an SSH session unless I input the command below.

PATH="/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/admin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"

Wondering what should be setting PATH and if anyone has ideas as to why it isn't being set properly. Thanks all for taking a look at this, it's not a major issue since I can manually set PATH but would like to try and fix it the right way if I can.

Everything does work fine for a short period of time after a reboot on the router so it does have it properly defined at least for a bit, not sure if that information helps. Also once it is lost I have to set it every time, when I exit the SSH session it is again not defined when I re-establish an SSH session.
You aren't by chance running the SSH client called SmarTTY, are you? This software has been known to screw around with the PATH as recently as a year ago. I had this type of head scratching PATH error when using that software, and it took some much smarter people to advise me to move over to MobaXTerm.
It's worth a shot for testing purposes to try any different SSH client.
 
You aren't by chance running the SSH client called SmarTTY, are you? This software has been known to screw around with the PATH as recently as a year ago. I had this type of head scratching PATH error when using that software, and it took some much smarter people to advise me to move over to MobaXTerm.
It's worth a shot for testing purposes to try any different SSH client.
Windows PowerShell 7.3.5 and Termux on my phone. Also tried putty but all doing the same thing. I'll try that other app you suggested later too.
 
So far looking good still fine after 2 hours with the flash drive removed. Did feel a bit warmer to the touch than I was expecting when I pulled it.

Edit: still good after 4.5 hours will check again in the morning, possible it's a failing flash drive.

Edit: still good the morning after with the flash drive removed, good possibility it is the flash drive failing
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top