Need help configuring entware for Back In Time.

Asked by Chris

So, I've managed to add all the packages I think back in time needs to use my router through entware for backing up my linux install. The only issue I have remaining is I get this error message whenever I try to connect Back In Time to my router.

Remote host doesn't support 'find PATH -type f -exec chmod u-wx {} \;':
find: unrecognized: -type
BusyBox v1.20.2 (2015-06-10 22:21:23 EDT) multi-call binary.

I've read through the manual and have tried changing /bin/sh to /opt/bin/bash in /etc/passwd. I've also tried adding /opt/bin:/opt/sbin to the start of the PATH environment variable in /etc/profiles. Whenever I do that I can no longer log into the router though ssh, and have to format the JFFS parition and reinstall entware.

Does anyone know how to get this working with an Asus AC66U?

Question information

Language:
English Edit question
Status:
Answered
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Germar (germar) said :
#1

As far as I can see entware ships BusyBox 1.23.2 and as the error reports BusyBox 1.20.2 you're still using your routers default BusyBox with reduced functions.

I never used entware so far (didn't know about this till now :) ). The man page is written with my experience with optware. So first of all please make sure entware is installed in /opt.

On my box /etc/profiles never worked with commands run through ssh. I think this is because there is no shell with 'ssh -c find ....'
Please run this command to create a ~/.ssh/environment file:
ssh user@host echo "PATH=/opt/bin:/opt/sbin:\$PATH" > ~/.ssh/environment

You also need to activate "PermitUserEnvironment yes" in your /etc/ssh/sshd_config on remote and restart remote sshd.

Revision history for this message
Germar (germar) said :
#2

Oh, and I'm using find from findutils package not BusyBox.

Good luck!

Revision history for this message
Chris (nowisnever) said :
#3

hmm, I can't find /etc/ssh

Revision history for this message
Chris (nowisnever) said :
#4

It's using Dropbear and not OpenSSH.

Revision history for this message
Chris (nowisnever) said :
#5

Well, I updated BusyBox and opkg shows the latest BusyBox 1.23.2 as being installed, but Back In TIme is still trying to use BusyBox 1.20.2

I think I'm at least partially using BuxyBox 1.23.2, since after I ran opkg install some file colors changed in the terminal.

Entware is installed in /opt.

Revision history for this message
Chris (nowisnever) said :
#6

Oh, and the latest findutils package is installed.

Revision history for this message
Chris (nowisnever) said :
#7

Oh and .ssh doesn't have a /environment in it.

Revision history for this message
Germar (germar) said :
#8

You're using BusyBox 1.23.2 if you log in with ssh. But if you run a command with 'ssh user@host find ...' you're still using BusyBox 1.20.2

I didn't test this but here http://serverfault.com/a/469652 suggest someone to create a /etc/profile.d/ssh_login.sh with this content (I ditched the echo line as this could break BIT):

#!/bin/sh
if [ "$SSH_CONNECTION" ]; then
    . /etc/environment
fi

Your /etc/environment should look like this:
PATH=/opt/bin:/opt/sbin:....followed by the stuff that was here before

Revision history for this message
Chris (nowisnever) said :
#9

Do I want to add profile.d to entware's etc or root's etc?

Revision history for this message
Germar (germar) said :
#10

root's etc

Revision history for this message
Chris (nowisnever) said :
#11

Ok, I added those commands to /etc/profile.d/ssh_login.sh. So, far I haven't had any luck getting busybox 1.23.2 when running commands through ssh user@host. The changes get blown away if I restart.

On my local drive I have an environment file with the PATH set starting with "/opt/bin:/opt/sbin:", after running ssh user@host echo "PATH=/opt/bin:/opt/sbin:\$PATH" > ~/.ssh/environment, but I don't have the additions to the path added to /etc/profile as it's read only. I can edit /entware/etc/profile is that the profile file I want?

 The default path in passwd is user:x:0:0:user:/root:/bin/sh. when I change it to user:x:0:0:user:/root/opt/bin/bash I get the login issue. There is passwd.custom available should I try modifying that?

Any other ideas? I appreciate all of your help so far.

Revision history for this message
Chris (nowisnever) said :
#12

To have /etc/profil.d/ssh_login.sh survive reboot, should I generate the script in the jffs partion's post-mount or service-start script?

Revision history for this message
Germar (germar) said :
#13

I'll add a new expert option to BackInTime where you can configure environ variables which will be send to remote before each and every command. Stay tuned for couple days.

Revision history for this message
Chris (nowisnever) said :
#14

Thanks.

Revision history for this message
Germar (germar) said :
#15

I add that function. Please upgrade to testing PPA:
sudo add-apt-repository ppa:bit-team/testing
sudo apt-get update
sudo apt-get upgrade

You'll find 'Add prefix to SSH commands' in 'Expert Options'. Just activate this. The default value should work. But you still need to switch remote shell to bash in /etc/passwd

Revision history for this message
Chris (nowisnever) said :
#16

Alright, I have in /bin I have sh, but no bash. In /tmp/mnt/Entware/entware/bin I have bash. Whenver I change sh to bash I can no longer log in. I changed user:x:0:0:user:/root:/bin/sh to user:x:0:0:user:/root:/opt/bin/bash. /opt is linked to /tmp/mnt/Entware/entware/bin. Should I add a /opt/etc/passwd in entware? What should the path look like in /opt/etc/passwd?

Revision history for this message
Chris (nowisnever) said :
#17

I got bash to work as the login shell through adding a startup script. I'm getting errors with sshfs. Does dropbear need sshfs support added?

Revision history for this message
Germar (germar) said :
#18

Yes, BIT need to mount the remote folder with sshfs

Please try this solution from ArchLinux wiki https://wiki.archlinux.org/index.php/Sshfs#Connection_reset_by_peer (4th topic)

sshfs -o sftp_server=/opt/libexec/sftp-server -o idmap=user <USER>@<HOST>:<PATH> /mnt

Revision history for this message
Chris (nowisnever) said :
#19

Cool, it works now, and I can back up as a regular user. I can't seem to get the root user key working, after copying it over to the server. (In Back in time at least)

Revision history for this message
Germar (germar) said :
#20

Do you use the same remote user for local regular and root user?

Revision history for this message
Chris (nowisnever) said :
#21

Yes, I do. I did generate a seperate key for the root user. I keep getting some message about needing a password for root.

Revision history for this message
Germar (germar) said :
#22

Please run in Terminal and post the output. Does it work if you manually login from root?

Revision history for this message
Chris (nowisnever) said :
#23

If I su into root this is what I get.

Computer user # rsync -av -delete -e ssh /home/user/BigFile.txt user@192.168.1.1:/tmp/mnt/Entware/entware/bin
sending incremental file list
BigFile.txt

sent 115 bytes received 35 bytes 100.00 bytes/sec
total size is 0 speedup is 0.00

And when I ssh in the file is in /opt/bin.

Can you help with this problem?

Provide an answer of your own, or ask Chris for more information if necessary.

To post a message you must log in.