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, 12:00 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 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, 12:12 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

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, 12:24 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

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, 01:41 PM
RMerlin's Avatar
RMerlin RMerlin is offline
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 11,536
Thanks: 62
Thanked 6,459 Times in 2,650 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, 02: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, 07:22 PM
RMerlin's Avatar
RMerlin RMerlin is offline
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 11,536
Thanks: 62
Thanked 6,459 Times in 2,650 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 11:41 PM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  354
L&LD  115
john9527  108
stevech  99
jegesq  91
azazel1024  91
htismaqe  88
huotg01  86
watusi  65
ColinTaylor  55
RMerlin  6458
john9527  514
stevech  358
ryzhov_al  298
TeHashX  263
L&LD  256
RogerSC  206
sinshiva  149
sfx2000  138
hggomes  132
Most Viewed Threads* Hottest Threads*
Old Why not...  8991
Old ASUS RT-N66U...  6599
Old Asuswrt-Merli...  6519
Old RT-AC66U...  3808
Old Why ASUS?  2558
Old NAS...  1988
Old OpenVPN...  1681
Old Remote...  1669
Old Asus...  1585
Old The future...  1437
Old Why not...  81
Old Asuswrt-Merli...  64
Old Remote...  50
Old Whats going...  32
Old The future...  26
Old RT-N66U...  26
Old Extension...  26
Old ASUS RT-N66U...  26
Old What are the...  25
Old OpenVPN...  25


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