DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-08-12 18:45:14

boupartac
Member
From: Montréal, Québec, Canada
Registered: 2008-07-29
Posts: 38

/ffp/bin/sh vs /bin/bash

Hi everybody,

I used to the bash shell under Linux/Ubuntu. With my DNS-323, I discovered that my shell is /ffp/bin/sh. There is no big deal about this, but I am wondering the big difference between the two? Anybody knows?

I usually have a .bashrc file in my home directory, under Ubuntu, that contains a lot of aliases. I created one on my DNS-323, but it is not sourced automatically when I log in (but is OK when i do ". .bashrc"). Is there a way to do such a thing?

Thanks

boupartac smile

Offline

 

#2 2008-08-12 19:14:21

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: /ffp/bin/sh vs /bin/bash

/ffp/bin/sh is not a bash. It's ash from busybox.
http://en.wikipedia.org/wiki/Shell_(computing)#UNIX_shells

If you want bash, install it and change your shell. http://www.inreto.de/dns323/fun-plug/0. … .html#bash

Offline

 

#3 2008-08-12 19:52:39

boupartac
Member
From: Montréal, Québec, Canada
Registered: 2008-07-29
Posts: 38

Re: /ffp/bin/sh vs /bin/bash

Woah, you really rock, fonz.

Thanks,

boupartac

Offline

 

#4 2008-08-12 20:41:18

boupartac
Member
From: Montréal, Québec, Canada
Registered: 2008-07-29
Posts: 38

Re: /ffp/bin/sh vs /bin/bash

Once bash installed, creating the file "~/.bashrc" is not enough; You must also create the file "~/.bash_profile" and add this to it:

if [ -f ~/.bashrc ]; then
    . ~/.bashrc;
fi

.bashrc = 644 = rw-r--r--
.bash_profile = 644 = rw-r--r--

Do not forget to replace the last field of the user, in /etc/passwd by /ffp/bin/bash
Once done, in root, store-passwd.sh to store changes in flash.

boupartac

Last edited by boupartac (2008-08-12 20:42:50)

Offline

 

#5 2008-08-12 20:43:22

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: /ffp/bin/sh vs /bin/bash

boupartac wrote:

Do not forget to replace the last field of the user, in /etc/passwd by /ffp/bin/bash

Code:

usermod -s /ffp/bin/bash username

Like this?

Offline

 

#6 2008-08-12 20:58:13

boupartac
Member
From: Montréal, Québec, Canada
Registered: 2008-07-29
Posts: 38

Re: /ffp/bin/sh vs /bin/bash

yop.. or you can go by hand if you like risks wink

Offline

 

#7 2009-05-24 06:29:24

lambretta
Member
Registered: 2009-01-07
Posts: 27

Re: /ffp/bin/sh vs /bin/bash

boupartac wrote:

Once bash installed, creating the file "~/.bashrc" is not enough; You must also create the file "~/.bash_profile" and add this to it:

if [ -f ~/.bashrc ]; then
    . ~/.bashrc;
fi

.bashrc = 644 = rw-r--r--
.bash_profile = 644 = rw-r--r--

Do not forget to replace the last field of the user, in /etc/passwd by /ffp/bin/bash
Once done, in root, store-passwd.sh to store changes in flash.

boupartac

Hi there.  I have the files as you have suggested when I converted to the bash shell however, when ever I log in now it come up with the following

-bash: [-f~/.bashrc]: No such file or directory

Any idea how to fix this?  Its works fine but its annoying me every time I log in.

Ta,

Lambretta.

Last edited by lambretta (2009-05-24 06:34:25)

Offline

 

#8 2009-05-25 05:18:11

lambretta
Member
Registered: 2009-01-07
Posts: 27

Re: /ffp/bin/sh vs /bin/bash

Never mind, the bash_profile file didn't have the correct spacing between the various commands in the file.  All fixed now, nothing to see here, move on....

:-)

Offline

 

#9 2009-06-14 21:50:00

DasCrushinator
Member
Registered: 2009-05-09
Posts: 34

Re: /ffp/bin/sh vs /bin/bash

Where are you guys placing your .bash_profile and .bashrc files? I log into the root account via SSH, but I was under the impression that /home/root was cleared with every shutdown/reboot.

Offline

 

#10 2009-06-15 09:10:14

lambretta
Member
Registered: 2009-01-07
Posts: 27

Re: /ffp/bin/sh vs /bin/bash

Root on my box still uses ash.  My user account uses bash so the .bashrc and the .bash_profile is in my users ~ directory.

Offline

 

#11 2009-06-15 09:11:24

DasCrushinator
Member
Registered: 2009-05-09
Posts: 34

Re: /ffp/bin/sh vs /bin/bash

lambretta wrote:

Root on my box still uses ash.  My user account uses bash so the .bashrc and the .bash_profile is in my users ~ directory.

Ah, so if I use root I am stuck with ash then since the /home/root gets wiped with every reboot?

Offline

 

#12 2009-06-15 10:15:55

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: /ffp/bin/sh vs /bin/bash

man usermod (see -d and -s)
Also, see http://dns323.kood.org/howto:ffp#shells

Offline

 

#13 2009-06-15 19:51:25

DasCrushinator
Member
Registered: 2009-05-09
Posts: 34

Re: /ffp/bin/sh vs /bin/bash

fonz wrote:

man usermod (see -d and -s)
Also, see http://dns323.kood.org/howto:ffp#shells

Sorry, I meant that I might as well be stuck with it since I wouldn't be able to have a configuration file (e.g. .bashrc).

Offline

 

#14 2009-06-16 09:36:30

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: /ffp/bin/sh vs /bin/bash

You can use whatever shell you like. The point is that ~/.profile or ~/.bashrc must be in ~, which is a problem when it's on the ramdisk. So, move ~ to a hard disk and you're done, which is what usermod -d does.

Offline

 

#15 2009-06-16 17:12:01

DasCrushinator
Member
Registered: 2009-05-09
Posts: 34

Re: /ffp/bin/sh vs /bin/bash

fonz wrote:

You can use whatever shell you like. The point is that ~/.profile or ~/.bashrc must be in ~, which is a problem when it's on the ramdisk. So, move ~ to a hard disk and you're done, which is what usermod -d does.

Ahh, I see. Thanks fonz!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB