I installed vsftpd.
sudo apt-get remove vsftpd
I installed vsftpd.
sudo apt-get remove vsftpd
- SYNOPSIS
- COMMON OPTIONS
- DESCRIPTION
- Remove a normal user
- Remove a user from a specific group
- OPTIONS
- RETURN VALUE
- FILES
- COPYRIGHT
- CONTENTS
- LAST SEARCHED
- SYNOPSIS
- COMMON OPTIONS
- DESCRIPTION
- Remove a normal user
- Remove a user from a specific group
- OPTIONS
- RETURN VALUE
- FILES
- COPYRIGHT
- CONTENTS
- LAST SEARCHED
- SYNOPSIS
- COMMON OPTIONS
- DESCRIPTION
- Add a normal user
- Add a user group
- Add a system group
- Add an existing user to an existing group
- OPTIONS
- EXIT VALUES
- FILES
- COPYRIGHT
- How to factory reset /delete all users in ubuntu 14. 04?
- Delete all users from group
- How to delete a file on ubuntu with another user?
- Can’t delete user account
SYNOPSIS
COMMON OPTIONS
DESCRIPTION
Remove a normal user
If the option
—only-if-empty
is given, the group won’t be removed if it has any members left.
Remove a user from a specific group
OPTIONS
- —conf FILE
- Use FILE instead of the default files
/etc/deluser.conf
and
/etc/adduser.conf - —group
- Remove a group. This is the default action if the program is invoked
as
delgroup. - —help
- Display brief instructions.
- —quiet
- Suppress progress messages.
- —system
- Only delete if user/group is a system user/group. This avoids
accidentally deleting non-system users/groups. Additionally, if the
user does not exist, no error value is returned. This option is mainly
for use in Debian package maintainer scripts. - —only-if-empty
- Only remove if no members are left.
- —backup
- Backup all files contained in the userhome and the mailspool-file to a file named
/$user.tar.bz2 or /$user.tar.gz. - —backup-to
- Place the backup files not in / but in the directory specified by this parameter. This implicitly sets —backup also.
- —remove-home
- Remove the home directory of the user and its mailspool. If —backup is specified,
the files are deleted after having performed the backup. - —remove-all-files
- Remove all files from the system owned by this user. Note: —remove-home does
not have an effect any more. If —backup is specified, the files are deleted after
having performed the backup. - —version
- Display version and copyright information.
RETURN VALUE
- 0
- The action was successfully executed.
- 1
- The user to delete was not a system account. No action was performed.
- 2
- There is no such user. No action was performed.
- 3
- There is no such group. No action was performed.
- 4
- Internal error. No action was performed.
- 5
- The group to delete is not empty. No action was performed.
- 6
- The user does not belong to the specified group. No action was performed.
- 7
- You cannot remove a user from its primary group. No action was performed.
- 8
- The required perl-package ‘perl modules’ is not installed. This package is required to perform the requested actions. No action was performed.
- 9
- For removing the root account the parameter «—force» is required. No action was performed.
FILES
- /usr/local/sbin/deluser.local
- Optional custom add-ons.
COPYRIGHT
LAST SEARCHED
SYNOPSIS
COMMON OPTIONS
DESCRIPTION
Remove a normal user
If the option
—only-if-empty
is given, the group won’t be removed if it has any members left.
Remove a user from a specific group
OPTIONS
- —conf FILE
- Use FILE instead of the default files
/etc/deluser.conf
and
/etc/adduser.conf - —group
- Remove a group. This is the default action if the program is invoked
as
delgroup. - —help
- Display brief instructions.
- —quiet
- Suppress progress messages.
- —system
- Only delete if user/group is a system user/group. This avoids
accidentally deleting non-system users/groups. Additionally, if the
user does not exist, no error value is returned. This option is mainly
for use in Debian package maintainer scripts. - —only-if-empty
- Only remove if no members are left.
- —backup
- Backup all files contained in the userhome and the mailspool-file to a file named
/$user.tar.bz2 or /$user.tar.gz. - —backup-to
- Place the backup files not in / but in the directory specified by this parameter. This implicitly sets —backup also.
- —remove-home
- Remove the home directory of the user and its mailspool. If —backup is specified,
the files are deleted after having performed the backup. - —remove-all-files
- Remove all files from the system owned by this user. Note: —remove-home does
not have an effect any more. If —backup is specified, the files are deleted after
having performed the backup. - —version
- Display version and copyright information.
RETURN VALUE
- 0
- The action was successfully executed.
- 1
- The user to delete was not a system account. No action was performed.
- 2
- There is no such user. No action was performed.
- 3
- There is no such group. No action was performed.
- 4
- Internal error. No action was performed.
- 5
- The group to delete is not empty. No action was performed.
- 6
- The user does not belong to the specified group. No action was performed.
- 7
- You cannot remove a user from its primary group. No action was performed.
- 8
- The required perl-package ‘perl modules’ is not installed. This package is required to perform the requested actions. No action was performed.
- 9
- For removing the root account the parameter «—force» is required. No action was performed.
FILES
- /usr/local/sbin/deluser.local
- Optional custom add-ons.
COPYRIGHT
LAST SEARCHED
SYNOPSIS
COMMON OPTIONS
DESCRIPTION
Add a normal user
The range specified in the configuration file may be overridden with the
—firstuid
and
—lastuid
options.
- 0 if
- —quiet
is specified - 1 if neither
- —quiet
nor
—debug
is specified - 2 if
- —debug
is specified
Add a user group
A GID will be chosen from the range specified for system GIDS in the
configuration file (FIRST_GID, LAST_GID). To override that mechanism you can give the GID using the
—gid
option.
Add a system group
If
addgroup is called with the
—system option, a system group will be added.
A GID will be chosen from the range specified for system GIDS in the
configuration file (FIRST_SYSTEM_GID, LAST_SYSTEM_GID). To override that mechanism you can give the GID using the
—gid
option.
Add an existing user to an existing group
OPTIONS
- —conf FILE
- Use FILE instead of
/etc/adduser.conf. - —disabled-login
- Do not run passwd to set the password. The user won’t be able to use
her account until the password is set. - —disabled-password
- Like —disabled-login, but logins are still possible (for example using
SSH RSA keys) but not using password authentication. - —force-badname
- By default, user and group names are checked against the configurable
regular expression
NAME_REGEX
specified in the configuration file. This option forces
adduser
and
addgroup
to apply only a weak check for validity of the name.
NAME_REGEX
is described in
adduser.conf(5). - —gecos GECOS
- Set the gecos field for the new entry generated.
adduser
will not ask for finger information if this option is given. - —gid ID
- When creating a group, this option forces the new groupid to be the
given number. When creating a user, this option will put the user in
that group. - —group
- When combined with
—system,
a group with the same name and ID as the system user is created.
If not combined with
—system,
a group with the given name is created. This is the default action if
the program is invoked as
addgroup. - —help
- Display brief instructions.
- —home DIR
- Use DIR as the user’s home directory, rather than the default specified by the
configuration file. If the directory does not exist, it is created
and skeleton files are copied. - —shell SHELL
- Use SHELL as the user’s login shell, rather than the default specified by the
configuration file. - —ingroup GROUP
- Add the new user to GROUP instead of a usergroup or the default group
defined by
USERS_GID
in the configuration file. This affects the users primary group. To add additional
groups, see the
add_extra_groups
option. - —no-create-home
- Do not create the home directory, even if it doesn’t exist.
- —quiet
- Suppress informational messages, only show warnings and errors.
- —debug
- Be verbose, most useful if you want to nail down a problem with adduser.
- —system
- Create a system user or group.
- —uid ID
- Force the new userid to be the given number.
adduser
will fail if the userid is already taken. - —firstuid ID
- Override the first uid in the range that the uid is chosen from (overrides
FIRST_UID
specified in the configuration file). - —lastuid ID
- Override the last uid in the range that the uid is chosen from (
LAST_UID
) - —add_extra_groups
- Add new user to extra groups defined in the configuration file.
- —version
- Display version and copyright information.
EXIT VALUES
- 0
- The user exists as specified. This can have 2 causes: The user was created by adduser or the user was already present on the system before adduser was invoked. If adduser was returning 0 , invoking adduser a second time with the same parameters as before also returns 0.
- 1
- Creating the user or group failed because it was already present with other UID/GID than specified. The username or groupname was rejected because of a mismatch with the configured regular expressions, see adduser.conf(5). Adduser has been aborted by a signal.
Or for many other yet undocumented reasons which are printed to console then. You may then consider to remove
—quiet
to make adduser more verbose.
FILES
- /etc/adduser.conf
- Default configuration file for adduser and addgroup
- /usr/local/sbin/adduser.local
- Optional custom add-ons.
COPYRIGHT
How to factory reset /delete all users in ubuntu 14. 04?
sudo deluser --remove-all-files username
rm -rf .gnome .gnome2 .gconf .gconfd .metacity
Delete all users from group
First you find all files owned by said group and assign them to a new group if you so desire (probably best, but not sure)
You then delete the group via sed
sudo sed -i -e 's/group_to_remove/d' /etc/group
grep -Po '^grp1:.*:.*:\K\w+' /etc/group > bad_users
If that’s still too many to handle, you can grep them out of
/etc/passwd
, generating a new one.
grep -vFf bad_users /etc/passwd > new_passwd
Let’s say the group gid is 2000
awk -F: "(\$4==2000) { print \$1 }" /etc/passwd | sudo xargs userdel
How to delete a file on ubuntu with another user?
cd /tmp
> test
chmod 666 test
#make file owned by a different user and group
chown tomcat:tomcat test
rm -r test
rm: cannot remove 'test': Operation not permitted
The
/tmp
directory is a «bit» special. It has the permissions
1777
which sets the sticky bit. You’ll see that an
ls -l /
shows
tmp
with the permissions:
drwxrwxrwt 25 root root 12288 Aug 3 08:20 tmp/
That
t
means that it prevents anyone except the owner from removing files. You’ll need to use a different directory. Additionally, the
-r
doesn’t make sense for a file.
Can’t delete user account
In a terminal:
/home$ ls
abuabdullah alzaabi hussain u942
Then I tried to delete account
u942
by using command line:
/home$ deluser u942
/usr/sbin/deluser: Only root may remove a user or group from the system.
Then I tried to use sudo
/home$ sudo deluser u942
/usr/sbin/deluser: The user `u942' does not exist.
How can I solve this problem?
getent passwd | grep "/home" | cut -d: -f1
If the output is empty, you can delete that folder (you might need sudo)
rm -Rf /home/u942
. But double check the contents of the folder before you delete it.
echo ~username
ls -ld /home/u942
stat -c %U /home/u942
To find it out you can do something like:
id -un `stat -c %U /home/u942`
If it returned nothing it means the owner does not exist on your system. simply remove that directory
If only you believe there is no important file there
.