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 offline
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 10,124
Thanks: 54
Thanked 5,605 Times in 2,304 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 offline
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 10,124
Thanks: 54
Thanked 5,605 Times in 2,304 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 07:42 PM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  356
stevech  153
KGB7  119
Kel-L  105
sfx2000  98
azazel1024  98
john9527  81
sinshiva  78
fistv  74
F5ing  68
RMerlin  5604
stevech  329
ryzhov_al  266
TeHashX  217
L&LD  192
RogerSC  190
sinshiva  143
joegreat  127
jlake  122
sfx2000  121
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  78523
Old Asuswrt-Merli...  48387
Old [Fork]...  20991
Old Asus locking...  10473
Old ASUS...  8584
Old Incoming...  8112
Old Asuswrt-Merli...  3525
Old Asuswrt-Merli...  3080
Old Thinking of...  2255
Old 376.44 -...  1811
Old Asuswrt-Merli...  393
Old Asuswrt-Merli...  221
Old [Fork]...  139
Old Asus locking...  125
Old Connection...  57
Old [HOW TO]...  50
Old ASUS...  50
Old Incoming...  44
Old 376.44 -...  40
Old Use the same...  35


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