PDA

Bekijk de volledige versie : .sh_history is possible to run?



greengreen
12-02-2007, 09:46
Hi,
is possible to run shell history for shell sh?
I try create .sh_history in my home directory and I add to my .profile
HISTFILE=/usr/local/root/.sh_history
HISTFILESIZE=500
HISTSIZE=500

but history isn't runing.

Can you someone help me?(or is it possible to run?)

thanks

WVR
20-02-2007, 17:35
history in the busybox shell seems fixed at around the last 10 commands

wirespot
21-02-2007, 16:56
...and it doesn't provide backwards search either (Ctrl+R). Just install bash and use that instead. If you have an external HDD attached it would also be a good idea to move your home dir on it. The default home dir is on the router virtual mem disk and is either lost on every reboot, or you can save it to the flash whenever you remember, but it's a hassle.

mistraller
23-02-2007, 13:45
...and it doesn't provide backwards search either (Ctrl+R). Just install bash and use that instead. If you have an external HDD attached it would also be a good idea to move your home dir on it. The default home dir is on the router virtual mem disk and is either lost on every reboot, or you can save it to the flash whenever you remember, but it's a hassle.
I tried this, by doing the following:
change /etc/passwd to:

username:Passwd Hash:0:0:root:/opt/home/username:/opt/bin/bash

And then:

passwd username

During my (putty ssh) session I could use "login username" which logged me in with the correct homedir and shell.

BUT

When I closed the putty session and restarted it I got "Access Denied" after logging in. Using Telnet everything worked out fine.

I also tried to restart dropbear, but no solution.

I didn't flashfs save commit enable and reboot, because I'm afraid of getting locked out.

Can you tell me how you figured this out?

mistraller
26-02-2007, 14:38
Solution found:

echo /opt/bin/bash >> /usr/shells

To add bash as accepted login shell.

greengreen
27-02-2007, 17:23
hi,
when I want to change shell sh to bash:

echo /opt/bin/bash >> /usr/shells
change /etc/passwd to:

username:Passwd Hash:0:0:root:/opt/home/username:/opt/bin/bash

After this changes I can't login over ssh.
where is bug?
thanks

mistraller
27-02-2007, 22:07
hi,
when I want to change shell sh to bash:

echo /opt/bin/bash >> /usr/shells
change /etc/passwd to:

username:Passwd Hash:0:0:root:/opt/home/username:/opt/bin/bash

After this changes I can't login over ssh.
where is bug?
thanks
Did you also change the homedir, or was it already working on that location?
I copied my homedir to opt (don't forget to use a tool that also copies permissions) before I did that change.

Another thing I did; after changing /etc/passwd I did

passwd username

It looks like the pashword hash is calculated on the complete sentence or something. (just a guess)