maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   change regular user to bash shell? (https://talk.maemo.org/showthread.php?t=64488)

extendedping 2010-10-27 16:06

change regular user to bash shell?
 
I just installed bash and see it has an option to run bash-setup to boot to bash as opposed to busybox.

I did this as root and hit no where it asked to overwrite my ??? .bashrc and everything works, I boot into bash as root.

I tried as regular "user" but it did not take (took to to busy box).

so I went in as root, did su - to user and ran bash-setup.

it asks 2 questions just like it did at root. I hit yes to change to bash and no to overwriting the .config file (? .bashrc).

well it did not change me to bash and all it did was mess up my prompt.

can you smart people help me? ideally I'd like bash for the user account but if I can't have that I just want my old prompt back...

davide 2010-10-27 17:01

Re: change regular user to bash shell?
 
just uninstall bash from app manager....

extendedping 2010-10-27 17:53

Re: change regular user to bash shell?
 
thanks, but I want bash and I want it for both user and root...I can't have that?

jedi 2010-10-27 17:58

Re: change regular user to bash shell?
 
I just edited /etc/passwd and changed /bin/sh to /bin/bash for root and user.

extendedping 2010-10-27 18:22

Re: change regular user to bash shell?
 
thanks I will uninstall, reinstall and then try the /etc/passwd method.

extendedping 2010-10-27 18:29

Re: change regular user to bash shell?
 
I uninstalled and my prompt as user came back. reinstalled bash and edited both user and root in /etc/passwd. root is not fine good prompt and bash. user is still busybox and has messed up prompt. ok I guess I will just do root, too bad.

jedi 2010-10-27 19:32

Re: change regular user to bash shell?
 
Is it the prompt that's the problem? If I remember correctly the default one is quite 'complex', especially on the N900 screen.

I edited /etc/profile.d/prompt and just added:
Code:

export PS1='N900:\W \$ '
at the end of the file, completely over-riding the code above it.

extendedping 2010-10-27 19:37

Re: change regular user to bash shell?
 
well the prompt does change (for the worse) for regular user but I could not get the user account to boot to bash, just root. I tried both bash-setup and changing the /etc/passwd for user.

I will just live with a good root prompt and bash on root. thanks

naturegodtm 2010-10-27 19:40

Re: change regular user to bash shell?
 
what can u do more in the bash shell?

juise- 2010-10-27 19:48

Re: change regular user to bash shell?
 
Quote:

Originally Posted by naturegodtm (Post 854093)
what can u do more in the bash shell?

My favorite is Ctrl+r for 'reverse-i-search', where you can type in any part of a previous command, and the shell will look it up for you.

That alone is enough reason to install bash (to me at least). The keyboard on N900 isn't bad, but it's not great for shell bashing. Being able to easily find that difficult-to-type line is nice.

Auto-completion on remote paths is also fun, it works if you are using public keys with ssh.

jd4200 2010-10-27 19:53

Re: change regular user to bash shell?
 
I've also had this problem since the beginning, bit of a pain to have to keep executing bash from busybox.
I also find that past commands aren't always written to bash_history.

Quote:

Originally Posted by juise- (Post 854105)
My favorite is Ctrl+r for 'reverse-i-search', where you can type in any part of a previous command, and the shell will look it up for you.

That alone is enough reason to install bash (to me at least). The keyboard on N900 isn't bad, but it's not great for shell bashing. Being able to easily find that difficult-to-type line is nice.

Auto-completion on remote paths is also fun, it works if you are using public keys with ssh.

If you like the reverse-search, you might like this for your bashrc:

Code:

# Searches .bash_history with up and down key
bind '"\e[A"':history-search-backward
bind '"\e[B"':history-search-forward

Type a letter or two of a command, hit up and it goes through all the ones that match.

naturegodtm 2010-10-27 19:53

Re: change regular user to bash shell?
 
isnt there any costum shell that enables bash? i have found my self too trying things that in a normal linuix system would work , but i got bizzar behavior on the output

jkq 2010-10-27 19:57

Re: change regular user to bash shell?
 
Quote:

Originally Posted by jedi (Post 853949)
I just edited /etc/passwd and changed /bin/sh to /bin/bash for root and user.

This worked for me, but I only changed the user entry. You may also want to try rebooting afterwards, but note that if you mess up /etc/passwd you may end up needing to reflash!

I don't recall if I had to do anything else, as it was quite a while ago.

-jkq

jd4200 2010-10-27 20:14

Re: change regular user to bash shell?
 
It also doesn't source the bashrc file with normal user, when switching to root it does.

I added "source .bashrc" (no quotes) at the bottom of /etc/profile (before unset -i) and this seems to work fine.

kopele 2010-10-27 20:27

Re: change regular user to bash shell?
 
Quote:

Originally Posted by extendedping (Post 853780)
I just installed bash and see it has an option to run bash-setup to boot to bash as opposed to busybox.

I did this as root and hit no where it asked to overwrite my ??? .bashrc and everything works, I boot into bash as root.

I tried as regular "user" but it did not take (took to to busy box).

so I went in as root, did su - to user and ran bash-setup.

it asks 2 questions just like it did at root. I hit yes to change to bash and no to overwriting the .config file (? .bashrc).

well it did not change me to bash and all it did was mess up my prompt.

can you smart people help me? ideally I'd like bash for the user account but if I can't have that I just want my old prompt back...

I ran into this a while back, if I remember correctly there is a problem with changing the login shell as a user. Try this to switch to bash:
Code:

root (or sudo gainroot)
chsh -s /bin/bash user

HTH

extendedping 2010-10-29 23:13

Re: change regular user to bash shell?
 
Quote:

Originally Posted by kopele (Post 854173)
I ran into this a while back, if I remember correctly there is a problem with changing the login shell as a user. Try this to switch to bash:
Code:

root (or sudo gainroot)
chsh -s /bin/bash user

HTH

thanks but that just messes up the user prompt.

dchky 2010-10-29 23:50

Re: change regular user to bash shell?
 
Quote:

Originally Posted by extendedping (Post 857145)
thanks but that just messes up the user prompt.

bash-setup now works as you would expect in PR1.3 - if you don't like the prompt you can change it in your .bashrc file.

extendedping 2010-10-30 00:37

Re: change regular user to bash shell?
 
Quote:

Originally Posted by dchky (Post 857170)
bash-setup now works as you would expect in PR1.3 - if you don't like the prompt you can change it in your .bashrc file.

tried for user:

bash-setup

chsh -s /bin/bash user

changing /etc/passwd user shell to /bin/bash

none of the above changed the user shell to bash.

extendedping 2010-10-31 14:33

Re: change regular user to bash shell?
 
So has anyone actually got bash as their default user shell?

I'm ready to give up on it

dchky 2010-10-31 14:57

Re: change regular user to bash shell?
 
Quote:

Originally Posted by extendedping (Post 858537)
So has anyone actually got bash as their default user shell?

I'm ready to give up on it

Yes. A fresh install of PR1.3, install bash followed by bash-setup, it worked perfectly as a regular user and as root.

If it doesn't work edit /etc/passwd and set the shall as /bin/bash there.

lunat 2010-10-31 15:15

Re: change regular user to bash shell?
 
Quote:

Originally Posted by dchky (Post 858554)
Yes. A fresh install of PR1.3, install bash followed by bash-setup, it worked perfectly as a regular user and as root.

If it doesn't work edit /etc/passwd and set the shall as /bin/bash there.

had it. but that changed with the update.... have reboot to see if i get it to work. sec!

lunat 2010-10-31 15:24

Re: change regular user to bash shell?
 
Quote:

Originally Posted by lunat (Post 858567)
had it. but that changed with the update.... have reboot to see if i get it to work. sec!

---
Nokia-N900:~# chsh user
Changing the login shell for user
Enter the new value, or press ENTER for the default
Login Shell [/bin/sh]: /bin/bash
---
maye you have to set a password.
edit:
as expected: password or not makes no difference: "chsh user" works just fine.

further never edit /etc/passwd. you never know what weird things a system does and passwords might be stored in several places - lucky you, that the phone actually has them in /etc/passwd.

kureyon 2010-10-31 18:57

Re: change regular user to bash shell?
 
Quote:

Originally Posted by lunat (Post 858575)
lucky you, that the phone actually has them in /etc/passwd.

Ouch, that's bad. Should be using shadow password

lunat 2010-10-31 19:08

Re: change regular user to bash shell?
 
Quote:

Originally Posted by kureyon (Post 858774)
Ouch, that's bad. Should be using shadow password

if they didn't change it with the update then this phone has no shadow paswords. but this is not what i ment. the user data can be held in any database or structure on a phone. and it makes sense to have some kind of registry. /etc/passwd is an old relict. you were lucky that the phone uses that relict from unix stoneages and no other means of storing the information.

the only thing that (should though isn't allways) be relyable is the accessmethodes. so chsh should change the shell using whatever is used on the phone to store the user data.

and it does.

br
[to make the difference clear: if chsh doesn't change the shell then chsh is broken and i would considder it a bug - the program doesn't work. if /etc/passwd is not used and you try to set the shell there it is you who used the wrong place ]

gsirit 2010-11-01 00:06

Re: change regular user to bash shell?
 
Quote:

Originally Posted by extendedping (Post 858537)
So has anyone actually got bash as their default user shell?

I'm ready to give up on it

Why don't you just add "bash" command to your ".profile" file in /home/user path?... It'll open bash every time your start xterm.

extendedping 2010-11-01 00:18

Re: change regular user to bash shell?
 
Quote:

Originally Posted by dchky (Post 858554)
Yes. A fresh install of PR1.3, install bash followed by bash-setup, it worked perfectly as a regular user and as root.

If it doesn't work edit /etc/passwd and set the shall as /bin/bash there.

tried both does not change user for me and I am at pr 1.3...too bad :(

I wonder why its is not working, again it changes my prompt but doing echo $SHELL shows /bin/sh for user while showing /bin/bash for root. so it did not work correct?

lunat 2010-11-01 00:26

Re: change regular user to bash shell?
 
Quote:

Originally Posted by gsirit (Post 859089)
Why don't you just add "bash" command to your ".profile" file in /home/user path?... It'll open bash every time your start xterm.

because there is a better way.

install the bash and become root(unfortionally they have configured user may not change it himself):
then simply type:
Code:

#chsh user
please don't fuss around with the passwd file!

[nb rant: that happens when you forbid the user to change things the easy way, they start doing dangerous things^^]

extendedping 2010-11-01 00:30

Re: change regular user to bash shell?
 
Quote:

Originally Posted by lunat (Post 859107)
because there is a better way.

install the bash and become root(unfortionally they have configured user may not change it himself):
then simply type:
Code:

#chsh user
please don't fuss around with the passwd file!

tried it, again changes prompt but keeps me at /bin/sh from the echo $SHELL command.

weird, why is this working for other but not for me? grrr.

extendedping 2010-11-01 00:36

Re: change regular user to bash shell?
 
Quote:

Originally Posted by lunat (Post 859107)
because there is a better way.

install the bash and become root(unfortionally they have configured user may not change it himself):
then simply type:
Code:

#chsh user
please don't fuss around with the passwd file!

[nb rant: that happens when you forbid the user to change things the easy way, they start doing dangerous things^^]

ok after a reboot I see I am user /bin/bash...so I am part way there...I still have a horrid prompt (too long and of course on this screen real estate is precious, hopefully I can get my old prompt back and keep /bin/bash.

btw here is my new prompt
[2]user@nokia-N900|~]

yucky right?

lunat 2010-11-01 00:40

Re: change regular user to bash shell?
 
Quote:

Originally Posted by extendedping (Post 859112)
tried it, again changes prompt but keeps me at /bin/sh from the echo $SHELL command.

weird, why is this working for other but not for me? grrr.

well then there are two things that could be wrong:
1. you messed something accidentely up(dont think so)
2. you need to log in again. reboot(... i'm lazy ).-

the difference is: i am via ssh on the phone and you open a xterm

lunat 2010-11-01 00:41

Re: change regular user to bash shell?
 
guessed right!

for the prompt copy the .bashrc from somewhere. should be in /etc/skel.
there is a part that needs tobe commented out or in. if you don't find it ask again. i need to reboot my phone if i want to look where it is and i don't want if not absolutely necessary.


All times are GMT. The time now is 06:37.

vBulletin® Version 3.8.8