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,897
Thanks: 56
Thanked 6,063 Times in 2,472 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,897
Thanks: 56
Thanked 6,063 Times in 2,472 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 04:12 AM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  414
john9527  163
azazel1024  116
htismaqe  104
sfx2000  88
ColinTaylor  73
stevech  72
AndreyPopov  62
TonyH  53
bbb0777  41
RMerlin  6062
john9527  394
stevech  351
ryzhov_al  280
TeHashX  237
L&LD  232
RogerSC  201
sinshiva  147
sfx2000  134
joegreat  126
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  32012
Old RT-AC68P...  3167
Old Brainstorming...  2769
Old Advice on...  2662
Old Looking for...  2401
Old Asus...  1865
Old Issues...  1832
Old Stable...  1765
Old AC-68...  1666
Old 3 months...  1510
Old Asuswrt-Merli...  229
Old Brainstorming...  49
Old Advice on...  49
Old Looking for...  35
Old RT-AC68P...  33
Old WiFi...  27
Old Stable...  25
Old Issues...  25
Old WiFi Rates  23
Old Firewall...  22


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