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,343
Thanks: 54
Thanked 5,778 Times in 2,359 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,343
Thanks: 54
Thanked 5,778 Times in 2,359 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 03:37 AM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  371
john9527  143
stevech  137
azazel1024  130
hggomes  88
noric  80
sfx2000  76
fistv  66
L&LD  66
TonyH  62
RMerlin  5777
stevech  336
john9527  281
ryzhov_al  272
TeHashX  228
L&LD  202
RogerSC  195
sinshiva  146
joegreat  127
sfx2000  124
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  12466
Old Asuswrt-Merli...  9221
Old My...  5292
Old Most stable...  4226
Old Asuswrt-Merli...  4173
Old Thinking of...  3881
Old RT-AC87R (U)...  3762
Old Connection...  3167
Old [HOW TO]...  2881
Old Can't trust...  2359
Old Asuswrt-Merli...  122
Old Connection...  59
Old Asuswrt-Merli...  56
Old My...  56
Old [HOW TO]...  50
Old RT-AC87R (U)...  39
Old USB N...  30
Old Most stable...  29
Old New...  28
Old Second new...  27


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