bash instead of ash

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
fusi
Beginner
Beginner
Posts: 24
Joined: Wed Apr 09, 2008 9:58 pm

bash instead of ash

Postby fusi » Fri Apr 11, 2008 7:59 pm

hi all!

my ds207+ came in the post a few days ago and im loving it - got 2x samsung spinpoint f1 750gb's in there and its great :D id also like to say that im really impressed with synology, its support and its ongoing development - top notch!

however, id much prefer bash to ash as a shell (i stuck the telnet patch on and have installed the bootstrap and mc etc) but im a bit of a linux noob so dont know how to do it safely on this device (ive read posts about the flash memory filling up and causing problems? dunno if its related) can anyone point me in the right direction? i searched this forum but i cant seem to find anything useful - any help would be very appreciated!

cheers
fusi
Laurence Benjamin
Rookie
Rookie
Posts: 32
Joined: Tue Nov 14, 2006 3:16 pm

Re: bash instead of ash

Postby Laurence Benjamin » Fri Apr 11, 2008 10:06 pm

Hi,

Install ipkg (http://www.nslu2-linux.org/wiki/DS101/DS101BootStrap). You may have done this already. If so, all you need to do is:

type "ipkg install bash"
press the return kek
ipkg will download the appropriate bash*.ipk package and install it.

type "bash"
you will see a default bash prompt like "bash-3.2#"

Job done

/Laurence
fusi
Beginner
Beginner
Posts: 24
Joined: Wed Apr 09, 2008 9:58 pm

Re: bash instead of ash

Postby fusi » Sat Apr 12, 2008 12:51 am

hi Laurence thanks for the reply!

through my tinkering about i have actually got to the stage you kindly describe :)

i actually installed the bootstrap from maartens site - dunno what the diference is if any? is one recommended over the other?

ive also installed man but its not picking up the manpages of the already installed stuff for some reason! D:

is there a way that i can make it the defaultshell for a user? ithink theres a config file somehwere that you can specify the shell to use :?

ooh and i dont suppose you or anyone else knows anything about the onboard flash getting full?

soz for the crap writing, on my phone atm!

the tinkering will continue!

cheers
fusi :)
Laurence Benjamin
Rookie
Rookie
Posts: 32
Joined: Tue Nov 14, 2006 3:16 pm

Re: bash instead of ash

Postby Laurence Benjamin » Sat Apr 12, 2008 12:54 pm

Hi Fusi,

I've no idea about the man pages but changing your default shell is simple.

open "/etc/passwd" in a text editor.
fields are sepparated by ":"
the first field shows the user and the final one shows the default shell for the user.
eg.
root:x:0:0:root:/root:/bin/ash - Shows that user root's default shell is "/bin/ash"

To change this:
change the "/bin/ash" to "/opt/bin/bash" (if this is where your bash binary is located) and save the file.

This takes effect from the next login. To check where any binary is located:

type "which [binary]" the output shows the location. eg.

# which bash
/opt/bin/bash

NOTE: You need to be very carefull if you change root's shell because if you later remove bash or a bash upgrade relocates bash binary or fails then you will not be able to login as root; there is no fallback shell Do this at your own risk.

/Laurence
fusi
Beginner
Beginner
Posts: 24
Joined: Wed Apr 09, 2008 9:58 pm

Re: bash instead of ash

Postby fusi » Sat Apr 12, 2008 5:36 pm

fantastic! thankyou very much!

shame you cant specify a fallback shell if eg it gets relocated like you say - ill try it on another user before root - i guess the best way might be to leave root alone and create my own user that has similar priviledges - i shall continue!

thanks again!
fusi
pascal
I'm New!
I'm New!
Posts: 1
Joined: Tue May 20, 2008 4:24 pm

Re: bash instead of ash

Postby pascal » Tue May 20, 2008 4:27 pm

hi

my solution:

add something like this line in /root/.profile
[ -e /opt/bin/tcsh ] && /opt/bin/tcsh

:)
User avatar
Val3r10
Apprentice
Apprentice
Posts: 99
Joined: Thu Jul 12, 2007 7:50 pm
Location: IT

Re: bash instead of ash

Postby Val3r10 » Mon Jun 23, 2008 7:28 pm

Nice solution, Pascal. The only one in this thread that works, though.
(btw /etc/shells should be edited too)

But this workaround nests a bash shell inside the ash one, doesn't override it.

Did anyone find a cleaner way to replace the default ash ?

Thanks for any answer

..._
Synology DS-106e - DSM v2.0-0728
- Happy WITH Bootstrap hack (and a bounce of ipkg packages installed)
- SSH enabled with working SFTP server (openssh-sftp)
- MTU 1500 no jumbo-frame
- Seagate ST3500630AS 500gb hdd (4 partitions = root/swp/ext3/fat32)
- Netgear GS605 gigabit 4+1 ports Switch
Stg Unholy
I'm New!
I'm New!
Posts: 1
Joined: Wed Mar 31, 2010 9:40 am

Re: bash instead of ash

Postby Stg Unholy » Wed Mar 31, 2010 9:48 am

Hi! By my mistake I made error in /etc/passwd file - I specified wrong path to bash for user account,
now I have it like:

root:x:0:0:root:/root:/bin/bash

and now I cannot ssh to NAS with root - it says that login denied.

I tried to change it back from admin user, but i cannot do it - file is readonly...
Are there any ways to solve this? :(
JailHouseRock
I'm New!
I'm New!
Posts: 4
Joined: Thu May 13, 2010 11:02 pm

Re: bash instead of ash

Postby JailHouseRock » Thu May 13, 2010 11:18 pm

I'm not sure, but if you have sudo installed you might be able to edit the /etc/passwd file.

Return to “General Mods”

Who is online

Users browsing this forum: No registered users and 1 guest