LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-06-2014, 06:34 PM   #1
dorsio
Member
 
Registered: Apr 2014
Distribution: Debian
Posts: 92

Rep: Reputation: 1
Can no remove symlinks, Busybox SSH shell


Can no remove symlinks: after rebooting device, symlinks appears again.
BusyBox SSH shell. These symlinks already existed, created by firmware.

Code:
login as: root
cd /nvram/1/security/
 ls
ab_cd.cer       mk_ehce.cer       efg_hr.cer      zooe_lsu.bin
download          fr_lkoy.bin    bkm_lua.bin

 ls -la
total 4
drwxr-xr-x    3 root     0                0 Jan  1 00:00 .
drwxr-xr-x    5 root     0                0 Jan  1 00:00 ..
-rwxrwxrwx    1 root     0              905 Jan  1 00:02 ab_cd.cer
drwxr-xr-x    2 root     0                0 Jan  1 00:00 download
lrwxrwxrwx    1 root     0               25 Jan  1 00:00 mk_ehce.cer -> /nvram/fw/bdm/mk_ehce.cer
lrwxrwxrwx    1 root     0               28 Jan  1 00:00 fr_lkoy.bin -> /nvram/fw/bdm/fr_lkoy.bin
-rwxrwxrwx    1 root     0             1052 Jan  1 00:02 efg_hr.cer
-rwxrwxrwx    1 root     0              140 Jan  1 00:02 bkm_lua.bin
lrwxrwxrwx    1 root     0               37 Jan  1 00:00 zooe_lsu.bin -> /etc/docsis/security/zooe_lsu.bin


rm mk_ehce.cer
rm fr_lkoy.bin

cd /nvram/fw/bdm/
ls -la

total 0
drwxr-xr-x    2 root     0                0 Jan  1 00:10 .
drwxr-xr-x    4 root     0                0 Aug  5  2014 ..

cd /nvram/1/security/

ls -la

total 4
drwxr-xr-x    3 root     0                0 Jan  1 00:07 .
drwxr-xr-x    5 root     0                0 Jan  1 00:00 ..
-rwxrwxrwx    1 root     0              905 Jan  1 00:02 ab_cd.cer
drwxr-xr-x    2 root     0                0 Jan  1 00:00 download
-rwxrwxrwx    1 root     0             1052 Jan  1 00:02 efg_hr.cer
-rwxrwxrwx    1 root     0              140 Jan  1 00:02 bkm_lua.bin
lrwxrwxrwx    1 root     0               37 Jan  1 00:00 zooe_lsu.bin -> /etc/docsis/security/zooe_lsu.bin


After rebooting:

cd /nvram/1/security/
ls -la
total 4
drwxr-xr-x    3 root     0                0 Jan  1 00:00 .
drwxr-xr-x    5 root     0                0 Jan  1 00:00 ..
-rwxrwxrwx    1 root     0              905 Jan  1 00:02 ab_cd.cer
drwxr-xr-x    2 root     0                0 Jan  1 00:00 download
lrwxrwxrwx    1 root     0               25 Jan  1 00:00 mk_ehce.cer -> /nvram/fw/bdm/mk_ehce.cer
lrwxrwxrwx    1 root     0               28 Jan  1 00:00 fr_lkoy.bin -> /nvram/fw/bdm/fr_lkoy.bin
-rwxrwxrwx    1 root     0             1052 Jan  1 00:02 efg_hr.cer
-rwxrwxrwx    1 root     0              140 Jan  1 00:02 bkm_lua.bin
lrwxrwxrwx    1 root     0               37 Jan  1 00:00 zooe_lsu.bin -> /etc/docsis/security/zooe_lsu.bin

Last edited by dorsio; 08-06-2014 at 06:49 PM.
 
Old 08-07-2014, 01:22 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
So find what is creating those symlinks..


But.. why are they a problem?
Why do you feel you need to remove them/
 
1 members found this post helpful.
Old 08-07-2014, 03:17 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
My guess is that busybox is a compiled package. You'd have to rebuild it to remove any references.
 
Old 08-07-2014, 03:52 PM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
They don't look like busybox symlinks
 
Old 08-07-2014, 03:56 PM   #5
dorsio
Member
 
Registered: Apr 2014
Distribution: Debian
Posts: 92

Original Poster
Rep: Reputation: 1
I think I managed to deal with this issue: this symlinks are actually firmware feature, firmware does not allow to remove or rename them, and file names are predefined. I needed to replace those files (first removing them). When files are properly named, they all are symlinks.

Last edited by dorsio; 08-07-2014 at 04:07 PM.
 
Old 08-07-2014, 04:54 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
You might find that it is some kind of initfs


As an example, an android boot image is the kernel and initfs 'packaged' together

In order to make a permanent adjustment you have to 'unpack', then unpack the initfs,, modify .. recreate initfs and finally repackage

I don't know what your device is..
See if you can work out the boot process
Maybe someone else already has?
 
Old 08-07-2014, 09:20 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
This is some kind of modem or router.
 
Old 08-08-2014, 07:17 AM   #8
dorsio
Member
 
Registered: Apr 2014
Distribution: Debian
Posts: 92

Original Poster
Rep: Reputation: 1
that's cable modem. I have no goal to rewrite the code, I just trying to figure how to replace the files properly. Sometimes I got ready symlinks after uploading new files, sometimes it does not. I have no source code. I can manage boot process via console, and can view file system via SFTP.
 
Old 08-08-2014, 07:47 AM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
the question is "Why are you trying to modify the symlinks?"

I think if you succeed your cable modem will no longer function correctly
 
Old 08-08-2014, 10:56 AM   #10
dorsio
Member
 
Registered: Apr 2014
Distribution: Debian
Posts: 92

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Firerat View Post
the question is "Why are you trying to modify the symlinks?"

I think if you succeed your cable modem will no longer function correctly
I need replace files, that's all. The files intended to be replaceable, I know this. I need to remove old and upload new files. I find that one of the files can not be downoaded. That's strange, is that something related to linux permissions? When I remove files from ssh, I remove only symlinks, not actual files? Where then actual files stored? (as symlinks are restored after reboot).

Last edited by dorsio; 08-08-2014 at 10:59 AM.
 
Old 08-08-2014, 11:00 AM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
ok, so replace the file which the symlink points to


don't replace
/nvram/1/security/zooe_lsu.bin

instead replace
/etc/docsis/security/zooe_lsu.bin
 
Old 08-08-2014, 11:32 AM   #12
dorsio
Member
 
Registered: Apr 2014
Distribution: Debian
Posts: 92

Original Poster
Rep: Reputation: 1
To remove files which are symlinks, should I use
rm mk_ehce.cer or

rm /nvram/fw/bdm/mk_ehce.cer?

Last edited by dorsio; 08-08-2014 at 11:34 AM.
 
Old 08-08-2014, 11:58 AM   #13
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
No.

There is no need to remove the symlinks

If you want to change the 'content of a symlink' then change the file the symlink points to


BUT before you go breaking your cable modem , learn the basics first.

As you do not understand what a symlink is I do not believe you are competent enough.,

But hey ... we learn faster from our mistakes .. so feel free to brick that cable modem.

Out of interest, , what is your end goal here (please don't say replace symlinks )

Are you trying to make it faster? More secure?

What is all this effot for?
 
Old 08-08-2014, 02:38 PM   #14
dorsio
Member
 
Registered: Apr 2014
Distribution: Debian
Posts: 92

Original Poster
Rep: Reputation: 1
Mainly for testing and researching, for improving it. That's test device. I know what is symlinks. But the Linux isn't what I know well. I flashed device more than once, successfully, and didn't brick it. Removing/replacing symlinks can not brick cable modem.

Last edited by dorsio; 08-08-2014 at 02:39 PM.
 
Old 08-08-2014, 03:58 PM   #15
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
You know this because you removed the symlinks and they reappeared?

You are probably right, no permo-brick, maybe 'soft'brick

If you understand what symlinks are.. why this thread?

Please understand, I don't wish to be combative

I'm not familiar with your device, and your goal is too 'open'
I think you need to seek advice from people experienced with your device

What is the device?
have you searched for forums specifically related to hacking that device?


I've given the answer to your symlink problem, replace the files the symlinks link to.
You say you understand symlinks,

If that is true.. this thread is solved, mark it as such!
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Busybox ash as a login shell prushik Linux - Software 2 05-01-2013 06:47 AM
[SOLVED] remove the network symlinks (/etc/rc.d/rc*.d) & Please help me! Forget-Me-Not Linux From Scratch 6 11-03-2012 11:51 PM
[SOLVED] how to remove the symlinks jayakumar01 Linux - Server 2 12-13-2011 11:01 AM
not getting shell prompt in busybox kumar_bst Linux - Kernel 1 08-03-2007 04:16 AM
Busybox as a shell D0M1N1C Linux - General 5 12-15-2005 04:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration