003 File Manager
Current Path:
/usr/sbin
usr
/
sbin
/
📁
..
📄
ac
(10.36 KB)
📄
accton
(5.66 KB)
📄
acpiconf
(9.14 KB)
📄
acpidb
(496.75 KB)
📄
acpidump
(39.86 KB)
📄
adduser
(23.38 KB)
📄
ancontrol
(34.19 KB)
📄
apm
(13.1 KB)
📄
arp
(17.88 KB)
📄
ath3kfw
(14.51 KB)
📄
audit
(5.98 KB)
📄
auditd
(21.79 KB)
📄
auditdistd
(127.49 KB)
📄
auditreduce
(15.34 KB)
📄
authpf
(20.57 KB)
📄
authpf-noip
(20.57 KB)
📄
automount
(50.65 KB)
📄
automountd
(50.65 KB)
📄
autounmountd
(50.65 KB)
📄
bcmfw
(8.68 KB)
📄
bhyve
(374.03 KB)
📄
bhyvectl
(41.55 KB)
📄
bhyveload
(16.41 KB)
📄
binmiscctl
(14.12 KB)
📄
blacklistctl
(33.88 KB)
📄
blacklistd
(41.85 KB)
📄
bluetooth-config
(9.71 KB)
📄
boot0cfg
(15.09 KB)
📄
bootparamd
(15.81 KB)
📄
bootpef
(38.09 KB)
📄
bootptest
(17.37 KB)
📄
bsdconfig
(11.98 KB)
📄
bsdinstall
(3.44 KB)
📄
bsnmpd
(136.55 KB)
📄
bthidcontrol
(36.06 KB)
📄
bthidd
(55.51 KB)
📄
btpand
(32.42 KB)
📄
btxld
(13.49 KB)
📄
callbootd
(9.26 KB)
📄
camdd
(37.59 KB)
📄
cdcontrol
(22.45 KB)
📄
certctl
(7.74 KB)
📄
chkgrp
(9.04 KB)
📄
chkprintcap
(18.22 KB)
📄
chown
(10.23 KB)
📄
chroot
(8.31 KB)
📄
ckdist
(16.18 KB)
📄
clear_locks
(6.23 KB)
📄
config
(56.23 KB)
📄
cpucontrol
(20.03 KB)
📄
crashinfo
(8.21 KB)
📄
cron
(44.9 KB)
📄
ctladm
(66.98 KB)
📄
ctld
(123.97 KB)
📄
cxgbetool
(2.86 MB)
📄
daemon
(15.76 KB)
📄
dconschat
(22.84 KB)
📄
devctl
(11.83 KB)
📄
devinfo
(8.68 KB)
📄
diskinfo
(19.2 KB)
📄
dtrace
(35.91 KB)
📄
dumpcis
(26.69 KB)
📄
dwatch
(36.59 KB)
📄
editmap
(84.02 KB)
📄
edquota
(22.9 KB)
📄
efibootmgr
(22.04 KB)
📄
efidp
(9.79 KB)
📄
efivar
(14.77 KB)
📄
etcupdate
(43.94 KB)
📄
extattrctl
(16.63 KB)
📄
fdcontrol
(14.94 KB)
📄
fdformat
(18.52 KB)
📄
fdread
(17.14 KB)
📄
fdwrite
(10.19 KB)
📄
fifolog_create
(9.03 KB)
📄
fifolog_reader
(31.19 KB)
📄
fifolog_writer
(15.57 KB)
📄
flowctl
(12.19 KB)
📄
fmtree
(36.11 KB)
📄
freebsd-update
(91.6 KB)
📄
fstyp
(19.38 KB)
📄
ftp-proxy
(28.19 KB)
📄
fwcontrol
(32.87 KB)
📄
gensnmptree
(29.26 KB)
📄
getextattr
(11.24 KB)
📄
getfmac
(6.78 KB)
📄
getpmac
(6.9 KB)
📄
gpioctl
(11.71 KB)
📄
gssd
(34.37 KB)
📄
gstat
(23.22 KB)
📄
hccontrol
(174.81 KB)
📄
hcsecd
(30.18 KB)
📄
hcseriald
(10.12 KB)
📄
hostapd
(876.65 KB)
📄
hostapd_cli
(79.18 KB)
📄
hoststat
(8.41 KB)
📄
hv_kvp_daemon
(21.99 KB)
📄
hv_vss_daemon
(9.45 KB)
📄
i2c
(14.99 KB)
📄
iasl
(1.34 MB)
📄
idprio
(7.61 KB)
📄
ifmcstat
(12.74 KB)
📄
inetd
(47.88 KB)
📄
iostat
(19.66 KB)
📄
iovctl
(19.91 KB)
📄
ip6addrctl
(12.2 KB)
📄
ipfwpcap
(10.79 KB)
📄
iprop-log
(24.89 KB)
📄
iscsid
(37.38 KB)
📄
iwmbtfw
(19.09 KB)
📄
jail
(68.96 KB)
📄
jexec
(8.85 KB)
📄
jls
(15.11 KB)
📄
kbdcontrol
(39.62 KB)
📄
kbdmap
(16.16 KB)
📄
keyserv
(24.67 KB)
📄
kgmon
(13.02 KB)
📄
kldxref
(29.59 KB)
📄
kstash
(9.68 KB)
📄
ktutil
(38.81 KB)
📄
l2control
(12.84 KB)
📄
l2ping
(10.6 KB)
📄
lastlogin
(8.5 KB)
📄
local-unbound
(148.45 KB)
📄
local-unbound-anchor
(38.63 KB)
📄
local-unbound-checkconf
(29.43 KB)
📄
local-unbound-control
(33.32 KB)
📄
local-unbound-setup
(11.7 KB)
📄
lockstat
(49.98 KB)
📄
lpc
(55.95 KB)
📄
lpd
(82.2 KB)
📄
lptcontrol
(6.48 KB)
📄
lptest
(6.03 KB)
📄
lsextattr
(11.24 KB)
📄
mailstats
(73.28 KB)
📄
mailwrapper
(8.41 KB)
📄
makefs
(183.64 KB)
📄
makemap
(89.47 KB)
📄
manctl
(7.75 KB)
📄
memcontrol
(11.88 KB)
📄
mergemaster
(43.59 KB)
📄
mfiutil
(75.3 KB)
📄
mixer
(12.14 KB)
📄
mld6query
(10.53 KB)
📄
mlx5tool
(11.54 KB)
📄
mlxcontrol
(19.72 KB)
📄
mount_smbfs
(15.29 KB)
📄
mountd
(54.05 KB)
📄
moused
(40.59 KB)
📄
mprutil
(33.95 KB)
📄
mpsutil
(33.95 KB)
📄
mptable
(15.74 KB)
📄
mptutil
(46.35 KB)
📄
mtest
(17.24 KB)
📄
mtree
(60.94 KB)
📄
ndis_events
(9.19 KB)
📄
ndiscvt
(39.78 KB)
📄
ndisgen
(15.83 KB)
📄
ndp
(24.03 KB)
📄
newsyslog
(46.39 KB)
📄
nfscbd
(10.15 KB)
📄
nfsd
(22.62 KB)
📄
nfsdumpstate
(8.02 KB)
📄
nfsrevoke
(6.08 KB)
📄
nfsuserd
(16.87 KB)
📄
ngctl
(29.15 KB)
📄
nghook
(10.09 KB)
📄
nmtree
(60.94 KB)
📄
nologin
(625.77 KB)
📄
nscd
(87.91 KB)
📄
ntp-keygen
(205.75 KB)
📄
ntpd
(842.26 KB)
📄
ntpdate
(126.85 KB)
📄
ntpdc
(268.29 KB)
📄
ntptime
(83.42 KB)
📄
pac
(28.74 KB)
📄
pciconf
(37.38 KB)
📄
periodic
(4.19 KB)
📄
pkg
(32.22 KB)
📄
plockstat
(22.91 KB)
📄
pmc
(167.45 KB)
📄
pmcannotate
(15.8 KB)
📄
pmccontrol
(11.81 KB)
📄
pmcstat
(77.77 KB)
📄
pnfsdscopymr
(9.09 KB)
📄
pnfsdsfile
(10.01 KB)
📄
pnfsdskill
(6.26 KB)
📄
portsnap
(29.86 KB)
📄
powerd
(15.97 KB)
📄
ppp
(427.13 KB)
📄
pppctl
(15.77 KB)
📄
praliases
(86.38 KB)
📄
praudit
(9.13 KB)
📄
prometheus_sysctl_exporter
(13.91 KB)
📄
pstat
(14.47 KB)
📄
purgestat
(8.41 KB)
📄
pw
(74.28 KB)
📄
pwd_mkdb
(16.71 KB)
📄
pwm
(10.45 KB)
📄
quot
(14.92 KB)
📄
quotaoff
(8.29 KB)
📄
quotaon
(8.29 KB)
📄
rarpd
(16.11 KB)
📄
repquota
(11.14 KB)
📄
rfcomm_pppd
(13.8 KB)
📄
rip6query
(7.69 KB)
📄
rmextattr
(11.24 KB)
📄
rmt
(9.48 KB)
📄
rmuser
(8.96 KB)
📄
route6d
(46.17 KB)
📄
rpc.lockd
(64.46 KB)
📄
rpc.statd
(22.27 KB)
📄
rpc.umntall
(12.3 KB)
📄
rpc.yppasswdd
(41.08 KB)
📄
rpc.ypupdated
(18.19 KB)
📄
rpc.ypxfrd
(16.12 KB)
📄
rpcbind
(43.91 KB)
📄
rrenumd
(34.28 KB)
📄
rtadvctl
(31.52 KB)
📄
rtadvd
(70.95 KB)
📄
rtprio
(7.61 KB)
📄
rtsold
(40.09 KB)
📄
rwhod
(17.15 KB)
📄
sa
(23.57 KB)
📄
sade
(48.1 KB)
📄
sdpcontrol
(15.98 KB)
📄
sdpd
(38.07 KB)
📄
sendmail
(8.41 KB)
📄
service
(4.84 KB)
📄
services_mkdb
(14.02 KB)
📄
sesutil
(20.83 KB)
📄
setextattr
(11.24 KB)
📄
setfib
(7.2 KB)
📄
setfmac
(14.27 KB)
📄
setfsmac
(14.27 KB)
📄
setpmac
(6.11 KB)
📄
smbmsg
(10.09 KB)
📄
snapinfo
(7.46 KB)
📄
sntp
(324.31 KB)
📄
spi
(15.59 KB)
📄
spkrtest
(3.62 KB)
📄
spray
(7.8 KB)
📄
sshd
(302.45 KB)
📄
swapinfo
(14.47 KB)
📄
syslogd
(53.15 KB)
📄
sysrc
(22.64 KB)
📄
tcpdchk
(19.85 KB)
📄
tcpdmatch
(16.88 KB)
📄
tcpdrop
(10.25 KB)
📄
tcpdump
(936.43 KB)
📄
traceroute
(33.23 KB)
📄
traceroute6
(30.32 KB)
📄
trim
(9.41 KB)
📄
trpt
(11.45 KB)
📄
tzsetup
(20.19 KB)
📄
uathload
(9.28 KB)
📄
uefisign
(20.87 KB)
📄
ugidfw
(8.57 KB)
📄
uhsoctl
(26.11 KB)
📄
usbconfig
(26.59 KB)
📄
usbdump
(16.42 KB)
📄
utx
(7.81 KB)
📄
valectl
(12.23 KB)
📄
vidcontrol
(27.79 KB)
📄
vidfont
(16.16 KB)
📄
vigr
(2.42 KB)
📄
vipw
(7.2 KB)
📄
wake
(7.33 KB)
📄
watch
(12.79 KB)
📄
watchdog
(15.37 KB)
📄
watchdogd
(15.37 KB)
📄
wlandebug
(16.26 KB)
📄
wpa_cli
(529.82 KB)
📄
wpa_passphrase
(37.72 KB)
📄
wpa_supplicant
(926.5 KB)
📄
yp_mkdb
(11.82 KB)
📄
ypbind
(20.45 KB)
📄
ypinit
(8.8 KB)
📄
ypldap
(93.28 KB)
📄
yppoll
(7.91 KB)
📄
yppush
(23.81 KB)
📄
ypserv
(43.55 KB)
📄
ypset
(7.36 KB)
📄
zdb
(164.94 KB)
📄
zdump
(13.48 KB)
📄
zfsd
(102.01 KB)
📄
zhack
(16.02 KB)
📄
zic
(42.48 KB)
📄
zonectl
(13.94 KB)
📄
zzz
(1.23 KB)
Editing: rmuser
#!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # # Copyright (c) 2002, 2003 Michael Telahun Makonnen. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Email: Mike Makonnen <mtm@FreeBSD.Org> # # $FreeBSD$ # ATJOBDIR="/var/at/jobs" CRONJOBDIR="/var/cron/tabs" MAILSPOOL="/var/mail" SIGKILL="-KILL" TEMPDIRS="/tmp /var/tmp" THISCMD=`/usr/bin/basename $0` PWCMD="${PWCMD:-/usr/sbin/pw}" # err msg # Display $msg on stderr. # err() { echo 1>&2 ${THISCMD}: $* } # verbose # Returns 0 if verbose mode is set, 1 if it is not. # verbose() { [ -n "$vflag" ] && return 0 || return 1 } # rm_files login # Removes files or empty directories belonging to $login from various # temporary directories. # rm_files() { # The argument is required [ -n $1 ] && login=$1 || return totalcount=0 for _dir in ${TEMPDIRS} ; do filecount=0 if [ ! -d $_dir ]; then err "$_dir is not a valid directory." continue fi verbose && echo -n "Removing files owned by ($login) in $_dir:" filecount=`find 2>/dev/null "$_dir" -user "$login" -delete -print | wc -l | sed 's/ *//'` verbose && echo " $filecount removed." totalcount=$(($totalcount + $filecount)) done ! verbose && [ $totalcount -ne 0 ] && echo -n " files($totalcount)" } # rm_mail login # Removes unix mail and pop daemon files belonging to the user # specified in the $login argument. # rm_mail() { # The argument is required [ -n $1 ] && login=$1 || return verbose && echo -n "Removing mail spool(s) for ($login):" if [ -f ${MAILSPOOL}/$login ]; then verbose && echo -n " ${MAILSPOOL}/$login" || echo -n " mailspool" rm ${MAILSPOOL}/$login fi if [ -f ${MAILSPOOL}/.${login}.pop ]; then verbose && echo -n " ${MAILSPOOL}/.${login}.pop" || echo -n " pop3" rm ${MAILSPOOL}/.${login}.pop fi verbose && echo '.' } # kill_procs login # Send a SIGKILL to all processes owned by $login. # kill_procs() { # The argument is required [ -n $1 ] && login=$1 || return verbose && echo -n "Terminating all processes owned by ($login):" killcount=0 proclist=`ps 2>/dev/null -U $login | grep -v '^\ *PID' | awk '{print $1}'` for _pid in $proclist ; do kill 2>/dev/null ${SIGKILL} $_pid killcount=$(($killcount + 1)) done verbose && echo " ${SIGKILL} signal sent to $killcount processes." ! verbose && [ $killcount -ne 0 ] && echo -n " processes(${killcount})" } # rm_at_jobs login # Remove at (1) jobs belonging to $login. # rm_at_jobs() { # The argument is required [ -n $1 ] && login=$1 || return atjoblist=`find 2>/dev/null ${ATJOBDIR} -maxdepth 1 -user $login -print` jobcount=0 verbose && echo -n "Removing at(1) jobs owned by ($login):" for _atjob in $atjoblist ; do rm -f $_atjob jobcount=$(($jobcount + 1)) done verbose && echo " $jobcount removed." ! verbose && [ $jobcount -ne 0 ] && echo -n " at($jobcount)" } # rm_crontab login # Removes crontab file belonging to user $login. # rm_crontab() { # The argument is required [ -n $1 ] && login=$1 || return verbose && echo -n "Removing crontab for ($login):" if [ -f ${CRONJOBDIR}/$login ]; then verbose && echo -n " ${CRONJOBDIR}/$login" || echo -n " crontab" rm -f ${CRONJOBDIR}/$login fi verbose && echo '.' } # rm_ipc login # Remove all IPC mechanisms which are owned by $login. # rm_ipc() { verbose && echo -n "Removing IPC mechanisms" for i in s m q; do ipcs -$i | awk -v i=$i -v login=$1 '$1 == i && $5 == login { print $2 }' | xargs -n 1 ipcrm -$i done verbose && echo '.' } # rm_user login # Remove user $login from the system. This subroutine makes use # of the pw(8) command to remove a user from the system. The pw(8) # command will remove the specified user from the user database # and group file and remove any crontabs. His home # directory will be removed if it is owned by him and contains no # files or subdirectories owned by other users. Mail spool files will # also be removed. # rm_user() { # The argument is required [ -n $1 ] && login=$1 || return verbose && echo -n "Removing user ($login)" [ -n "$pw_rswitch" ] && { verbose && echo -n " (including home directory)" ! verbose && echo -n " home" } ! verbose && echo -n " passwd" verbose && echo -n " from the system:" ${PWCMD} userdel -n $login $pw_rswitch verbose && echo ' Done.' } # prompt_yesno msg # Prompts the user with a $msg. The answer is expected to be # yes, no, or some variation thereof. This subroutine returns 0 # if the answer was yes, 1 if it was not. # prompt_yesno() { # The argument is required [ -n "$1" ] && msg="$1" || return while : ; do echo -n "$msg" read _ans case $_ans in [Nn][Oo]|[Nn]) return 1 ;; [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) return 0 ;; *) ;; esac done } # show_usage # (no arguments) # Display usage message. # show_usage() { echo "usage: ${THISCMD} [-yv] [-f file] [user ...]" echo " if the -y switch is used, either the -f switch or" echo " one or more user names must be given" } #### END SUBROUTINE DEFENITION #### ffile= fflag= procowner= pw_rswitch= userlist= yflag= vflag= procowner=`/usr/bin/id -u` if [ "$procowner" != "0" ]; then err 'you must be root (0) to use this utility.' exit 1 fi args=`getopt 2>/dev/null yvf: $*` if [ "$?" != "0" ]; then show_usage exit 1 fi set -- $args for _switch ; do case $_switch in -y) yflag=1 shift ;; -v) vflag=1 shift ;; -f) fflag=1 ffile="$2" shift; shift ;; --) shift break ;; esac done # Get user names from a file if the -f switch was used. Otherwise, # get them from the commandline arguments. If we're getting it # from a file, the file must be owned by and writable only by root. # if [ $fflag ]; then _insecure=`find $ffile ! -user 0 -or -perm +0022` if [ -n "$_insecure" ]; then err "file ($ffile) must be owned by and writeable only by root." exit 1 fi if [ -r "$ffile" ]; then userlist=`cat $ffile | while read _user _junk ; do case $_user in \#*|'') ;; *) echo -n "$userlist $_user" ;; esac done` fi else while [ $1 ] ; do userlist="$userlist $1" shift done fi # If the -y or -f switch has been used and the list of users to remove # is empty it is a fatal error. Otherwise, prompt the user for a list # of one or more user names. # if [ ! "$userlist" ]; then if [ $fflag ]; then err "($ffile) does not exist or does not contain any user names." exit 1 elif [ $yflag ]; then show_usage exit 1 else echo -n "Please enter one or more usernames: " read userlist fi fi _user= _uid= for _user in $userlist ; do # Make sure the name exists in the passwd database and that it # does not have a uid of 0 # userrec=`pw 2>/dev/null usershow -n $_user` if [ "$?" != "0" ]; then err "user ($_user) does not exist in the password database." continue fi _uid=`echo $userrec | awk -F: '{print $3}'` if [ "$_uid" = "0" ]; then err "user ($_user) has uid 0. You may not remove this user." continue fi # If the -y switch was not used ask for confirmation to remove the # user and home directory. # if [ -z "$yflag" ]; then echo "Matching password entry:" echo echo $userrec echo if ! prompt_yesno "Is this the entry you wish to remove? " ; then continue fi _homedir=`echo $userrec | awk -F: '{print $9}'` if prompt_yesno "Remove user's home directory ($_homedir)? "; then pw_rswitch="-r" fi else pw_rswitch="-r" fi # Disable any further attempts to log into this account ${PWCMD} 2>/dev/null lock $_user # Remove crontab, mail spool, etc. Then obliterate the user from # the passwd and group database. # ! verbose && echo -n "Removing user ($_user):" rm_crontab $_user rm_at_jobs $_user rm_ipc $_user kill_procs $_user rm_files $_user rm_mail $_user rm_user $_user ! verbose && echo "." done
Upload File
Create Folder