the trouble after deleting User
Results 1 to 9 of 9

Thread: the trouble after deleting User

  1. #1
    Member
    Join Date
    Dec 2001
    Posts
    35

    Question the trouble after deleting User

    I am using SuSE 7.2 and when I went to User and group administration, I found where were many login ID, I thought those ID were no usefull, so I deleted those IDs except root and my own Login ID, but after that, I found I cannot login by my own ID, luckly root is still work! how can I restore my setting! thanks.
    I got the message: xterm:Couldnot exec bin/bash: Permission denied
    Share on Google+

  2. #2
    Member
    Join Date
    Dec 2001
    Posts
    35
    I reinstalled the system again, the problem was solved, but anyone could please tell me why that problem happened,and what does those users exist for?
    Share on Google+

  3. #3
    PHP/PostgreSQL guy
    Join Date
    Dec 2001
    Posts
    1,164
    Generally, it's a *very bad* idea to just up and delete users you think aren't needed as everything from 0 UID to 20 UID (or the first 10 or so accounts in /etc/passwd) are system related accounts that the system uses. Several programs and such rely on a certain "user" to log in automatically by the system to run a command or something and if it's not there or something else is wrong, things go bad.
    We the willing, led by the unknowing, have been doing the impossible for the ungrateful. We have done so much with so little for so long that we are now qualified to do just about anything with almost nothing.
    Share on Google+

  4. #4
    Member
    Join Date
    Dec 2001
    Posts
    35
    that's for sure it was a bad idea. but is there any way to restore my original setting?
    Share on Google+

  5. #5
    PHP/PostgreSQL guy
    Join Date
    Dec 2001
    Posts
    1,164
    Whenever I make a change to /etc/passwd, I always use 'vipw' to do it, as it makes a /tmp backup that you're working on and if you bail out or the system somehow crashes, it won't write to /etc/passwd. I *always* make a backup manually of /etc/passwd, /etc/group, /etc/fstab and other important files because you never know when you might need them.

    As for restoring your original setting, if all you did was 'userdel user_name' from /etc/passwd, then you could do the following to restore them. Assume /etc/passwd.orig is a backup prior to your changes.

    <QUICK AND DIRTY>
    for i in `cat /etc/passwd.orig | awk -F: '{ print $1 }'`
    do
    USER=$i
    UID=`grep "^$i:" /etc/passwd.orig | awk -F: '{ print $3 }'`
    GID=`grep "^$i:" /etc/passwd.orig | awk -F: '{ print $4 }'`
    INFO=`grep "^$i:" /etc/passwd.orig | awk -F: '{ print $5 }'`
    HOME=`grep "^$i:" /etc/passwd.orig | awk -F: '{ print $6 }'`
    SHELL=`grep "^$i:" /etc/passwd.orig | awk -F: '{ print $7 }'`
    useradd -m -c "$INFO" -s $SHELL -g $GID -u $UID $USER
    echo "$USER re-added to the system"
    done
    </QUICK AND DIRTY>

    That should re-add them with the home, shell, info, etc etc. Most system accounts are locked by default so that nobody can log in as them. Hope this helps. PM me if you need more help.
    We the willing, led by the unknowing, have been doing the impossible for the ungrateful. We have done so much with so little for so long that we are now qualified to do just about anything with almost nothing.
    Share on Google+

  6. #6
    Member
    Join Date
    Dec 2001
    Posts
    35

    Unhappy

    thanks for your help. I thought that will be what I need, but unfortunately I really have no idea how to do that, where should I add your code to? which program do I need to launch? and one more worse thing is I never bachup anything before! I didn't find the file named as passwd.orig. Yes, there are only two users in /etc/passwd, passwd- and passwd.YaST2save. what can I do? could you please show me step by step!

    Appreciated! Merry Chrismas!
    Share on Google+

  7. #7
    Member
    Join Date
    Dec 2001
    Posts
    35
    And also there is another problem happened: sometimes I cannot control my mouse(Microsoft IntellimMouse Optical USB and PS/2 Compatible), when I touch the mouse, it goes to anywhere, but sometimes it works well. Is that problem caused by deleting users? also My SuSE Linux 7.2 doesn't support USB devices. How can I solve that problem?

    Thanks.
    Share on Google+

  8. #8
    PHP/PostgreSQL guy
    Join Date
    Dec 2001
    Posts
    1,164
    The 'program' I wrote out is more of a script and depends on the password file backup. Unfortunately, if you don't have a backup, then you're pretty much out of luck unless you can find another user who uses Suse and compare against theirs. As for the mouse, you should be able to use usb devices as the daemon 'usb-uhci' controls all of them. It's looking like you might have to reinstall completely, which is unusual given the normal nature of Linux, but for this, I'm thinking that's the only thing you can really do at this time.

    Merry Christmas to you too!
    We the willing, led by the unknowing, have been doing the impossible for the ungrateful. We have done so much with so little for so long that we are now qualified to do just about anything with almost nothing.
    Share on Google+

  9. #9
    Member
    Join Date
    Dec 2001
    Posts
    35
    that's too bad! but anyway I learned one thing that is IF I AM NOT SURE SOMETHING, DON'T DO THAT!!

    thanks for your help very much! Merry Christmas!
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •