Hi
Slight typo by sandyd.
Code:
UN="<Your_username>" && sudo useradd --gid $UN --groups adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare -d /home/$UN -M -N -s /bin/bash $UN
Change <Your_username> to your user name.
It assumes that your main user group still exists (-N). This is probably a valid assumption.
It assumes you still have your home directory (-M) and that switch was most probably put in there for this comment.
i can still access my stuff through another Distro i have installed, but cannot login to the distro i put this command in!
However, from man userdel.
-f, --force
This option forces the removal of the user account, even if the user is still logged in.
It also forces userdel to
remove the user's home directory and mail spool, even if another user uses the same home directory or if the mail spool
is not owned by the specified user. If USERGROUPS_ENAB is defined to yes in /etc/login.defs and if a group exists with
the same name as the deleted user, then this group will be removed, even if it is still the primary group of another
user.
Code:
for i in `cat /etc/passwd | awk -F":" '{print $1}'`
do uid=`cat /etc/passwd | grep "^${i}:" | awk -F":" '{print $3}'`
[ "$uid" -gt "998" -a "$uid" -ne "65534" ] &&
userdel --force ${i} 2>/dev/null done
Are you sure you can access your home directory ? I would check you still have a home directory. If not the above command will need tweaking.
userdel --force will delete a user .
Kind regards
Bookmarks