Jump to content

User Admin: Login Shell editing problem [solved]


Peter Snow
 Share

Recommended Posts

I seem to have messed up one of the users on the system and need some help to please!

 

When I was trying to change the users home directory, something seems to have gone wrong and everytime I saved my changes in Mandriva Control Center, the Login Shelll field, gets duplicated to itself.

 

This has resulted in the field currently set to:

:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash

:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash:/bin/bash

:/bin/bash

 

I´ve tried all the obvious stuff like delete it, change it, etc and those do not help. I´m wondering if this is saved somewhere in plain text, where I can just edit the text of a text file and save it?

 

I´m running Mandriva ONE 2008.

 

Thanks in advance.

 

peter

Link to comment
Share on other sites

This information is saved in /etc/passwd. For user 'peter' the line would look something like this:

peter:x:501:501:Whatever comment you gave during install:/home/peter:/bin/bash

I guess in your case it reads /bin/bash:/bin/bash etc.

 

Be very carefull when editing this file (only possible as root). Mistakes may mean several users including yourself have no access anymore thus rendering your system unusable.

 

An alternative approach is by using the usermod command. The following command should move the current home-dir for user peter (assumed to be /home/peter) from '/home/peter' to '/home/new':

usermod -d /home/new -m peter

Again this is only possible as root.

Link to comment
Share on other sites

Thanks buddy, I'll give it a try modifying the file (or I will at least have a look at it when I can get on the machine). So long as I don't do anything stupid, I guess I should be safe.

 

I can't use the command line option since I'm not trying to move the home directory right now. I'm just trying to correct the issue with the shell.

 

I'll let you know how I get on. :)

Link to comment
Share on other sites

Just a quick word of warning. Editing /etc/passwd can sometimes be a bad thing. Especially if a system has shadow passwords, which most tend to nowadays. Screwing with /etc/passwd can end up with completely blocking any user from accessing the system, including root!

 

I guess you were lucky this time, but something to point out in case you need to do this again. I can't remember exactly how I did it last time, or how I recovered or even if I recovered.

 

usermod is best for sorting the bash thing:

 

usermod -s /bin/bash username

 

would modify the user without having to directly edit the /etc/passwd file, replacing username in the above with the user that was screwed up.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...