Peter Snow Posted November 18, 2007 Report Share Posted November 18, 2007 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 Quote Link to comment Share on other sites More sharing options...
pindakoe Posted November 18, 2007 Report Share Posted November 18, 2007 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. Quote Link to comment Share on other sites More sharing options...
Peter Snow Posted November 20, 2007 Author Report Share Posted November 20, 2007 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. :) Quote Link to comment Share on other sites More sharing options...
Peter Snow Posted November 27, 2007 Author Report Share Posted November 27, 2007 Thanks for your help. Sorry to take so long to get back to you. I edited the file directly (after I eventually found away to open it as route) and it all worked out ok and solved a multitude of problems. Regards Peter Snow Bookkeeping & Tax Accounting Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted November 27, 2007 Report Share Posted November 27, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.