LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 11-16-2004, 02:06 PM   #1
Dcrusoe
Member
 
Registered: Oct 2004
Location: San Diego
Distribution: Mandrake Linux 10.1
Posts: 30

Rep: Reputation: 15
How to change user shell - Mandrake 10.1 Community


As a unix user I should know this but for some reason as a new user to Linux I can't set this up. Bash is a nice shell but I'm used to korn and c chell and so I used the first the basic configuration tool then the expert web config tool then tired doing it from the command line by doing a cp of the /etc/cshrc script and profile to the user home directory but after a log out and a reboot I still have bash in my env. So I've missed some silly thing that will cause me to slip myself with an egg. Any ideas what the h I missed forgot?

Thanks in advance!
 
Old 11-16-2004, 02:31 PM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
Code:
cat /etc/shells
chsh  [-s login_shell] [user]
so you would want
Code:
chsh -s /bin/ksh Dcrusoe
to get korn

-- 'the only restrictions placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the super-user, and then any value may be added.'

Last edited by secesh; 11-16-2004 at 02:34 PM.
 
Old 11-16-2004, 09:35 PM   #3
Dcrusoe
Member
 
Registered: Oct 2004
Location: San Diego
Distribution: Mandrake Linux 10.1
Posts: 30

Original Poster
Rep: Reputation: 15
How to change user shell - errors out

Okay it doesn't error however it doesn't change the shell either LOL

Okay I checked that I do have a shell I want, and looked at the man page it actually calls for a -s option but, it does some strange errors and it acts like it changes the shell but doesn't.
[dcrusoe@master ~]$ grep dcrusoe /etc/passwd
dcrusoe:x:501:501avid Howell:/u/dcrusoe:/bin/bash
My shell is bash

[dcrusoe@master ~]$ ls -l /bin/tcsh
-rwxr-xr-x 1 root root 310124 Jun 17 11:25 /bin/tcsh

Changing it to tcsh

[dcrusoe@master ~]$ chsh -s /bin/tcsh dcrusoe
Changing shell for dcrusoe.
Password:
Shell not changed.

It prompts for a pass word as you can see and I gave it dcruoses
Prompts for the passwd so how about roots pass word

[dcrusoe@master ~]$ chsh -s /bin/tcsh dcrusoe
Changing shell for dcrusoe.
Password:
Password error.

nope so su to root

[dcrusoe@master ~]$ su
Password:
[root@master dcrusoe]# chsh -s /bin/tcsh dcrusoe
Changing shell for dcrusoe.
Shell not changed.

But is it? /etc/passwd now says it is.

[root@master dcrusoe]# grep dcrusoe /etc/passwd
dcrusoe:x:501:501avid Howell:/u/dcrusoe:/bin/tcsh

and so does my env

[dcrusoe@master ~]$ env | grep -y shell
SHELL=/bin/tcsh

However it is still a bash shell and works like a bash shell after a log out and log in and even after a complete reboot.

So again anyone ever do this? A bug? Or something bad on my intall? Or bad /etc/passwd.

This is a very new install BTW.

Any suggestions from here? It isn't a big deal I just didn't want to work so hard relearning yet another shell LOL

Again thank you in advance for any help you might offer.

Dc
 
Old 11-16-2004, 11:47 PM   #4
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
hmm... dunno, i guess this is a distro problem... never seen that

Mandrake 10, huh... i'll see if i can't dig that tomorrow...
 
Old 11-17-2004, 11:10 AM   #5
Dcrusoe
Member
 
Registered: Oct 2004
Location: San Diego
Distribution: Mandrake Linux 10.1
Posts: 30

Original Poster
Rep: Reputation: 15
RE: How to change user shell - errors out

Okay so I gave up and just created a new user with the tcsh to begin with. Worked fine on everything except firefox LOL Thanks for the suggestions. I got to dig for a command reference set to learn the different commands. IT's different but the same coming from a ATT based Unix to the BSD based linux. I must say I do like this site and this group!

Thanks again!
 
Old 11-17-2004, 03:32 PM   #6
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
good luck then, i won't worry about your chsh problem...

wish i could give you something along the lines of a command reference, but i never found one [really good one] myself... everything i know i picked up somewhere along the way...
 
Old 11-18-2004, 01:25 PM   #7
boydasilva
LQ Newbie
 
Registered: Nov 2004
Location: Manchester
Distribution: Suse 10.0
Posts: 27

Rep: Reputation: 15
I want to change from BASH to TCSH, and I changed login shell via the start, user administration, then change login shell. It says that I'm logging in with a TSCH, but i'm still getting bash when I open a konsole. Am I missing something? I don't really want to have to create a new user like Dcrusoe did.
 
Old 11-18-2004, 07:16 PM   #8
Dcrusoe
Member
 
Registered: Oct 2004
Location: San Diego
Distribution: Mandrake Linux 10.1
Posts: 30

Original Poster
Rep: Reputation: 15
RE: want to change from BASH to TCSH

You don't say which version your on but you may just have to. I tried a few different ways. I will creat a test uesr and play with it and let you know tomorrow.
 
Old 11-18-2004, 07:25 PM   #9
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
i'll guess mandrake 10, he's got his distro listed in his profile...

here's my only comment, based on this quote:
Quote:
and I changed login shell via the start, user administration, then change login shell
can't really help ya -- i've never run mandrake, and i ain't quite sure what you're doing... only way i know to change a user's shell is by using chsh...
 
Old 11-18-2004, 08:15 PM   #10
Dcrusoe
Member
 
Registered: Oct 2004
Location: San Diego
Distribution: Mandrake Linux 10.1
Posts: 30

Original Poster
Rep: Reputation: 15
change from BASH to TCSH

OKay I think I understand but I don't but that is okay it's linux! LOL Try changing the shell for the user you want as root with the user logged out. I double checked the shells I had both listed in /etc/shells and /bin then I created a user with tcsh and as root tried changing the shell to ksh. as you can see below it failed with a non informative error message. but I then tried changing it to bash and it worked, then I tried changing it to ksh and as you can see below that also worked. I logged in as the user and the shell does correctly come up. Note that the man page states

"chsh will accept the full pathname of any executable file on the system."

But as you can also see below it wants the full path even though the shell is listed in /etc/shells.

So try that and if that doesn't work for you then you may then break down and reset your user. Which isn't that much trouble I just copied out my files, deleted the shell and created the user and copied the stuff back in.

good luck

Dc
<==================listed of my commands================>
[root@master root]# more /etc/shells
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
[root@master root]# chsh -s /bin/ksh testy
Changing shell for testy
Shell not changed.
[root@master root]# chsh -s bash testy
Changing shell for testy
chsh: shell must be a full path name.
[root@master root]# chsh -s /bin/bash testy
Changing shell for testy
Shell changed.
[root@master root]# chsh -s /bin/ksh testy
Changing shell for testy
Shell changed.
 
Old 11-23-2004, 11:37 AM   #11
boydasilva
LQ Newbie
 
Registered: Nov 2004
Location: Manchester
Distribution: Suse 10.0
Posts: 27

Rep: Reputation: 15
I still can't do it. I just keep getting "shell not changed". Am I putting in the wrong path for the tcsh? I have no idea where it is and it ain't very obvious.

Where's it likely to be?
 
Old 11-23-2004, 11:45 AM   #12
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
/bin/tcsh
 
Old 11-23-2004, 11:49 AM   #13
boydasilva
LQ Newbie
 
Registered: Nov 2004
Location: Manchester
Distribution: Suse 10.0
Posts: 27

Rep: Reputation: 15
It still won't change the shell, whether I'm logged in as user or as root. Hmmm.
 
Old 11-23-2004, 01:42 PM   #14
boydasilva
LQ Newbie
 
Registered: Nov 2004
Location: Manchester
Distribution: Suse 10.0
Posts: 27

Rep: Reputation: 15
I seem to have made it all work now, tragically I have no idea how.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM
what is the command to make a user change their password after creating a new user? naweenio Linux - Newbie 7 01-05-2005 07:07 AM
SNMP community string change - SERVER CRASH nishil Linux - Networking 2 11-21-2004 09:14 PM
How do I change the cursors globaly for a user? and how do I change them in the E-WM? enigma Z Linux - Software 1 09-18-2004 03:59 PM
New Slack User!!! Appreciates Community!!! boutrosboutros Slackware 4 01-03-2004 08:49 PM


All times are GMT -5. The time now is 06:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration