3

I have a project with a wrt54gl modem, and we need to copy a file from computer into modem (in modem /bin folder), but we have a problem when we copy the file with scp copy: "permission denied".

We try to set permissions on /bin folder, but it does not change.

Is there a way for changing permissions on /bin folder (in wrt54)?

sr_
  • 15,224
  • 49
  • 55
  • 1
    On what partition is `/bin` (see `mount`)? These embedded Linux distributions can be peculiar in this respect, see [here](http://www.dd-wrt.com/wiki/index.php/Firmware_FAQ#Why_is_there_no_jffs-space_left.3F_Why_can.27t_I_write_to_directories_other_than_.2Ftmp.3F) and [here](http://www.dd-wrt.com/wiki/index.php/Journalling_Flash_File_System) – sr_ May 09 '12 at 13:22
  • Why do you need to put it in `/bin`? What's your goal? Perhaps we can find another folder also convenient where it will be possible to put you file. – Huygens May 09 '12 at 15:53

2 Answers2

4

I don't think you can do this. The "/" filesystem in DD-WRT is Squashfs, although that's not easy to find out. That means that during a build of DD-WRT, a whole filesystem image gets set up, and then compressed in some manner, which renders it immutable. That way, the root filesystem fits in a router's small amount of flash.

A few config files are on read/write storage on /tmp, which is ramfs on my DD-WRT router. /etc/resolv.conf is a symlink to /tmp/resolv.conf, All the crontab stuff is links to /tmp, /etc/hosts is a symlink to /tmp/hosts.

It's not clear what you want to do with the file in /bin, but about the best you can do is scp the file to /tmp, and run it from there. You could re-generate a whole Squashfs filesystem with the file in /bin, and re-flash the router, but that seems like an awful lot of work.

0

Can you ssh into the modem with an account that can modify the permissions of /bin? If so, I'd use ssh and then chmod on the /bin folder to give the account that you use with scp write access.

Edd
  • 763
  • 1
  • 5
  • 6