SmallNetBuilder Forums
Go Back   SmallNetBuilder Forums > Wireless Networking > ASUS Wireless > Asuswrt-Merlin

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-21-2013, 11:00 AM
kha kha is offline
New Member
 
Join Date: Feb 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
kha is just starting out
Default Permission denied on several scripts

Hello,

This morning I logged onto my RT-N66U with latest Merlin firm. (Firmware Version:3.0.0.4.270.24 (Merlin build)) to check crontabs.

I ran:

Code:
cru l
and got:

Code:
[kha@RT-N66U root]$ cru l
/usr/sbin/cru: line 4: nvram: Permission denied
Line 4 is:

Code:
F="$D/`nvram get http_username`"
If i run it it works:

Code:
[kha@RT-N66U root]$ nvram get http_username
kha
It's like the interpreter does not work... Yetserday I installed through ipkg packages bash, bash-completion and core-utils... I am wondering what can cause this issue: when runnign scripts, it's like the interpreter does not have any right to run binaries...

i also tried to run

Code:
ipkg update
but got:

Code:
[kha@RT-N66U root]$ ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz
sh: wget: Permission denied
Downloading http://dlcdnet.asus.com/pub/ASUS/wireless/ASUSWRT/Packages.gz
sh: wget: Permission denied
An error ocurred, return value: 2.
Collected errors:
ipkg_download: ERROR: Command failed with return value 127: `wget    -q -P /opt/ipkg-CQBWnZ http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz'
ipkg_download: ERROR: Command failed with return value 127: `wget    -q -P /opt/ipkg-CQBWnZ http://dlcdnet.asus.com/pub/ASUS/wireless/ASUSWRT/Packages.gz'
Reply With Quote
  #2  
Old 02-21-2013, 11:12 AM
kha kha is offline
New Member
 
Join Date: Feb 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
kha is just starting out
Default

I removed bash-completion and bash package and cru now works.

But ipkg update till cannot download some packages:

Code:
kha@RT-N66U:/tmp/home/root# ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/optware.oleg
Downloading http://dlcdnet.asus.com/pub/ASUS/wireless/ASUSWRT/Packages.gz
wget: server returned error: HTTP/1.1 404 Not Found
An error ocurred, return value: 1.
Collected errors:
ipkg_download: ERROR: Command failed with return value 1: `wget    -q -P /opt/ipkg-YTYTJ0 http://dlcdnet.asus.com/pub/ASUS/wireless/ASUSWRT/Packages.gz'
Reply With Quote
  #3  
Old 02-21-2013, 11:24 AM
kha kha is offline
New Member
 
Join Date: Feb 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
kha is just starting out
Default

Does someone knows why bash did not work for me ? Also is there another URL I can set to make ipkg update work ?
Reply With Quote
  #4  
Old 02-21-2013, 12:41 PM
RMerlin's Avatar
RMerlin RMerlin is online now
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 8,607
Thanks: 44
Thanked 4,494 Times in 1,906 Posts
RMerlin is just starting out
Default

That error message is normal. Asus doesn't have a fully working optware repo, so there's no Packages.gz file.
__________________
Asuswrt-Merlin: Customized firmware for Asus routers
Github: github.com/RMerl - Twitter: RMerlinDev
See the sticky post for more info.
Reply With Quote
  #5  
Old 02-21-2013, 01:47 PM
kha kha is offline
New Member
 
Join Date: Feb 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
kha is just starting out
Default

And for the bash install not working properly, do you have an idea ?
Reply With Quote
  #6  
Old 02-21-2013, 06:22 PM
RMerlin's Avatar
RMerlin RMerlin is online now
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 8,607
Thanks: 44
Thanked 4,494 Times in 1,906 Posts
RMerlin is just starting out
Default

Quote:
Originally Posted by kha View Post
And for the bash install not working properly, do you have an idea ?
No idea, you only posted logs of the ipkg update, not of the bash install attempt.
__________________
Asuswrt-Merlin: Customized firmware for Asus routers
Github: github.com/RMerl - Twitter: RMerlinDev
See the sticky post for more info.
Reply With Quote
  #7  
Old 05-13-2013, 11:09 PM
nobode nobode is offline
New Member
 
Join Date: May 2013
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
nobode is just starting out
Default

After installing bash, the prompt changed from # to $, indicating a loss of root privilege.

It's a optware-related issue, because a long time ago when I use TomatoUSB I had the same problem, and I solved it by editng some file like /opt/etc/profile, but I don't remember exactly nor how, nether can I google anything out today. Waiting for a solution.

Here is how to reproduce the issue:

1. Make a clean install of optware. Can be done by installing Asus DownloadMaster and then uninstall it.

2. telnet/ssh to router, you will be prompted with a # and no problem.

3. ipkg install bash, then exit the telnet/ssh session.

4. re-telnet/ssh, you'll be prompted with a $, root privilege lost.

5. umount the optware device. re-telnet/ssh, you gain root again, no problem.

6. telnet/ssh after optware device mounted, you lost root.

Appreciate a solution
Reply With Quote
  #8  
Old 05-14-2013, 11:09 AM
nobode nobode is offline
New Member
 
Join Date: May 2013
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
nobode is just starting out
Default

I got it. Edit /opt/etc/profile
change this line
LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
to
LD_LIBRARY_PATH=/lib:/opt/lib:${LD_LIBRARY_PATH}

Problem solved. So it's a lib path search order issue.

BTW, the PS1 should end with \$, instead of $, otherwise always shows $.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 05:52 PM.

Top 10 Stats
Top Posters* Top Thanked
RMerlin  408
stevech  158
thelonelycode...  147
L&LD  126
azazel1024  115
KGB7  89
jim769  82
DrTeeth  71
Adamm  64
speedingcheet...  61
RMerlin  4494
stevech  275
ryzhov_al  199
TeHashX  194
RogerSC  166
L&LD  163
joegreat  105
jlake  102
PrivateJoker  93
sinshiva  88
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  32330
Old Asuswrt-Merli...  25943
Old ASUS...  22973
Old Beta Version...  17566
Old 'Heartbleed'...  14394
Old Linksys...  9648
Old Potential...  7967
Old Asus-Merlin...  7170
Old Groundhog...  6453
Old Linksys...  5959
Old Asuswrt-Merli...  220
Old Asuswrt-Merli...  193
Old Linksys...  148
Old ASUS...  125
Old Beta Version...  112
Old Potential...  98
Old Linksys...  79
Old Groundhog...  49
Old Asus router...  43
Old USB drive...  39



Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2006-2014 Pudai LLC All Rights Reserved.