通过网络安全地编辑sudo文件

如果你按照我的另一个关于“vipw”和“vigr”的帖子,那么不需要解释。它和这两个命令做的一样。打开/ etc / sudoers文件并附上一个锁。一旦你完成了随着它,锁被释放,变化反映到原始文件。它将在vi编辑器中打开一个tmp文件,让你有机会编辑sudoers文件secure.visudo解析编辑后的sudoers文件,并不会保存如果发现语法错误,则会发生变化,当发现​​错误时,visudo将打印一条消息,指出发生错误的行号,用户将收到“What now?”提示,此时用户可以输入“ e“重新编辑sudoers文件,”x“退出而不保存更改,或者”Q“退出并保存更改。”Q“选项应该非常谨慎,因为如果visudo认为需要解析错误,sudo也会出现错误,并且没有人能够再次sudo直到错误被修复。如果输入“e”来编辑su在检测到分析错误后,doers文件会将光标放在发生错误的行上(如果编辑器支持此功能).PS:虽然我已经体验过我自己,但很少有人向我表明它的行为糟糕一些分布,值得注意的是SLES.But问题可以稍微纠正一点。
.

0

linux命令:visudo visudo visudorootopen.com
linux命令:visudo visudo visudorootopen.com
ldtd 2018-05-20 18:23:48
输出

评论

相关推荐

curl -sLkIv --stderr - https://t.co/2rQjHfptZ8 -s: silences the output when piped to a different command -L: follow every redirect -k: ignores certificate errors -I: just request the headers -v: be verbose --stderr - : redirect stderr to stdout https://t.co/2rQjHfptZ8

linux命令:curl -sLkIv --stderr - http://example.org | grep -i location: | awk {'print $3'} | sed '/^$/d' '/^$/d' sed | $3'} {'print awk | location: -i grep | http://example.org - --stderr -sLkIv curl curl -sLkIv --stderr - http://example.org | grep -i location: | awk {'print $3'} | sed '/^$/d'rootopen.com
linux命令:curl -sLkIv --stderr - http://example.org | grep -i location: | awk {'print $3'} | sed '/^$/d' '/^$/d' sed | $3'} {'print awk | location: -i grep | http://example.org - --stderr -sLkIv curl curl -sLkIv --stderr - http://example.org | grep -i location: | awk {'print $3'} | sed '/^$/d'rootopen.com
.

首先,find命令查找当前目录(.)中的所有文件。 这将通过管道连接到xargs,以便能够并行运行下一个shell管道。 xargs -P参数指定要并行运行多少个进程,可以将这个值设置得比核心计数高, 因为读取的持续时间主要是IO绑定的。 find和xargs的-print0和-0参数分别用于轻松处理带有空格或其他特殊字符的文件。 xargs执行一个子shell,为find找到的每个文件提供一个shell管道。 该管道提取持续时间并将其转换为awk易于解析的格式。 ffmpeg读取文件并打印大量相关信息, grep提取持续时间行。 cut和sed删除时间信息,tr转换最后一个。 a:用awk更容易分割。 awk是一种用于shell脚本的专用编程语言。 这里我们使用它将时间元素分割成4个变量并将它们相加。

linux命令: find . -print0 | xargs -0 -P 40 -n 1 sh -c 'ffmpeg -i "$1" 2>&1 | grep "Duration:" | cut -d " " -f 4 | sed "s/.$//" | tr "." ":"' - | awk -F ':' '{ sum1+=$1; sum2+=$2; sum3+=$3; sum4+=$4 } END { printf "%.0f:%.0f:%.0f.%.0f\n", sum1, sum2, sum3, sum4 }' }' sum4 sum3, sum2, sum1, "%.0f:%.0f:%.0f.%.0f\n", printf { END } sum4+=$4 sum3+=$3; sum2+=$2; sum1+=$1; '{ ':' -F awk | - ":"' "." tr | "s/.$//" sed | 4 -f " " -d cut | "Duration:" grep | 2>&1 "$1" -i 'ffmpeg -c sh 1 -n 40 -P -0 xargs | -print0 . find find . -print0 | xargs -0 -P 40 -n 1 sh -c 'ffmpeg -i "$1" 2>&1 | grep "Duration:" | cut -d " " -f 4 | sed "s/.$//" | tr "." ":"' - | awk -F ':' '{ sum1+=$1; sum2+=$2; sum3+=$3; sum4+=$4 } END { printf "%.0f:%.0f:%.0f.%.0f\n", sum1, sum2, sum3, sum4 }'rootopen.com
linux命令: find . -print0 | xargs -0 -P 40 -n 1 sh -c 'ffmpeg -i "$1" 2>&1 | grep "Duration:" | cut -d " " -f 4 | sed "s/.$//" | tr "." ":"' - | awk -F ':' '{ sum1+=$1; sum2+=$2; sum3+=$3; sum4+=$4 } END { printf "%.0f:%.0f:%.0f.%.0f\n", sum1, sum2, sum3, sum4 }' }' sum4 sum3, sum2, sum1, "%.0f:%.0f:%.0f.%.0f\n", printf { END } sum4+=$4 sum3+=$3; sum2+=$2; sum1+=$1; '{ ':' -F awk | - ":"' "." tr | "s/.$//" sed | 4 -f " " -d cut | "Duration:" grep | 2>&1 "$1" -i 'ffmpeg -c sh 1 -n 40 -P -0 xargs | -print0 . find find . -print0 | xargs -0 -P 40 -n 1 sh -c 'ffmpeg -i "$1" 2>&1 | grep "Duration:" | cut -d " " -f 4 | sed "s/.$//" | tr "." ":"' - | awk -F ':' '{ sum1+=$1; sum2+=$2; sum3+=$3; sum4+=$4 } END { printf "%.0f:%.0f:%.0f.%.0f\n", sum1, sum2, sum3, sum4 }'rootopen.com
.

Example: touch file{1,2,3}; chmod 777 !*

linux命令:chmod 777 !* !* 777 chmod chmod 777 !*rootopen.com
linux命令:chmod 777 !* !* 777 chmod chmod 777 !*rootopen.com
.

linux命令:echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc echo echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dcrootopen.com
linux命令:echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc echo echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dcrootopen.com
.

linux命令:lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -u -u sort | 's/.*://' sed | $1}' $8, $9, '{print awk | -nlP -i lsof lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -urootopen.com
linux命令:lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -u -u sort | 's/.*://' sed | $1}' $8, $9, '{print awk | -nlP -i lsof lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -urootopen.com
.

查看root文件下哪个目录占用了最多的空间非常有用

linux命令:find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -n -n sort | {}" -sk du || {} -q "mountpoint -c sh {} -I xargs | d -type 1 -maxdepth / find find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -nrootopen.com
linux命令:find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -n -n sort | {}" -sk du || {} -q "mountpoint -c sh {} -I xargs | d -type 1 -maxdepth / find find / -maxdepth 1 -type d | xargs -I {} sh -c "mountpoint -q {} || du -sk {}" | sort -nrootopen.com
.

linux命令: find / -maxdepth 1 -mindepth 1 -type d -exec du -skx {} \; | sort -n -n sort | \; {} -skx du -exec d -type 1 -mindepth 1 -maxdepth / find find / -maxdepth 1 -mindepth 1 -type d -exec du -skx {} \; | sort -nrootopen.com
linux命令: find / -maxdepth 1 -mindepth 1 -type d -exec du -skx {} \; | sort -n -n sort | \; {} -skx du -exec d -type 1 -mindepth 1 -maxdepth / find find / -maxdepth 1 -mindepth 1 -type d -exec du -skx {} \; | sort -nrootopen.com
.

适用于删除那些以空格开头的注释或包含空格的空行

linux命令:grep -vE '^\s*(#|$)' textfile textfile '^\s*(#|$)' -vE grep grep -vE '^\s*(#|$)' textfilerootopen.com
linux命令:grep -vE '^\s*(#|$)' textfile textfile '^\s*(#|$)' -vE grep grep -vE '^\s*(#|$)' textfilerootopen.com
.

在我看来,这更可靠。

linux命令:curl -s https://www.kernel.org/releases.json | jq '.latest_stable.version' -r -r '.latest_stable.version' jq | https://www.kernel.org/releases.json -s curl curl -s https://www.kernel.org/releases.json | jq '.latest_stable.version' -rrootopen.com
linux命令:curl -s https://www.kernel.org/releases.json | jq '.latest_stable.version' -r -r '.latest_stable.version' jq | https://www.kernel.org/releases.json -s curl curl -s https://www.kernel.org/releases.json | jq '.latest_stable.version' -rrootopen.com
.

替换在文件夹中递归找到的一个或多个文件中匹配模式的字符串。

linux命令:find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \; \; {} 's/foo/bar/g' -e -i sed -exec "somefile.txt" -name f -type ./ find find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \;rootopen.com
linux命令:find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \; \; {} 's/foo/bar/g' -e -i sed -exec "somefile.txt" -name f -type ./ find find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \;rootopen.com
.

当运行完free i-node时,它可以用来确定文件数量最多的路径

linux命令:find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10 10 -n tail | -n sort | -c uniq | sort | 's@^\(.*\)/[^/]*$@\1@' sed | '^/\(dev\|proc\|run\|sys\).*' -regex ! f -type / find find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10rootopen.com
linux命令:find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10 10 -n tail | -n sort | -c uniq | sort | 's@^\(.*\)/[^/]*$@\1@' sed | '^/\(dev\|proc\|run\|sys\).*' -regex ! f -type / find find / -type f ! -regex '^/\(dev\|proc\|run\|sys\).*' | sed 's@^\(.*\)/[^/]*$@\1@' | sort | uniq -c | sort -n | tail -n 10rootopen.com
.

Excludes other mountpoints with acavagni's "mountpoint" idea, but with -exec instead of piping to an xargs subshell. Then, calling "du" only once with -exec's "+" option. The first "\! -exec" acts as a test so only those who match are passed to the second "-exec" for du.

linux命令:find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -h -h sort | + {} -xsh du -exec \; {} -q mountpoint -exec \! -empty \! d -type 1 -mindepth 1 -maxdepth / find find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -hrootopen.com
linux命令:find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -h -h sort | + {} -xsh du -exec \; {} -q mountpoint -exec \! -empty \! d -type 1 -mindepth 1 -maxdepth / find find / -maxdepth 1 -mindepth 1 -type d \! -empty \! -exec mountpoint -q {} \; -exec du -xsh {} + | sort -hrootopen.com
.

如果在使用程序时,您得到一个类似于:加载共享库时出错:libus -0.1.so.4: 无法打开共享对象文件:没有这样的文件或目录使用pacman或pkgfile搜索拥有丢失库的包https://wiki.archlinux.org/index.php/General_troubleshooting#Message:_%22error_while_loading_shared_libraries%22

linux命令:pacman -Fs libusb-0.1.so.4 libusb-0.1.so.4 -Fs pacman pacman -Fs libusb-0.1.so.4rootopen.com
linux命令:pacman -Fs libusb-0.1.so.4 libusb-0.1.so.4 -Fs pacman pacman -Fs libusb-0.1.so.4rootopen.com
.

linux命令:python -m ensurepip --default-pip && python -m pip install --upgrade pip setuptools wheel wheel setuptools pip --upgrade install pip -m python && --default-pip ensurepip -m python python -m ensurepip --default-pip && python -m pip install --upgrade pip setuptools wheelrootopen.com
linux命令:python -m ensurepip --default-pip && python -m pip install --upgrade pip setuptools wheel wheel setuptools pip --upgrade install pip -m python && --default-pip ensurepip -m python python -m ensurepip --default-pip && python -m pip install --upgrade pip setuptools wheelrootopen.com
.

linux命令: hydra -I -V -T 5 -t 2 -s 5001 -M /tmp/syno https-post-form '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' -L ./ruby-syno-brut/user -P ruby-syno-brut/passlist-short-2.txt ruby-syno-brut/passlist-short-2.txt -P ./ruby-syno-brut/user -L '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' https-post-form /tmp/syno -M 5001 -s 2 -t 5 -T -V -I hydra hydra -I -V -T 5 -t 2 -s 5001 -M /tmp/syno https-post-form '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' -L ./ruby-syno-brut/user -P ruby-syno-brut/passlist-short-2.txtrootopen.com
linux命令: hydra -I -V -T 5 -t 2 -s 5001 -M /tmp/syno https-post-form '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' -L ./ruby-syno-brut/user -P ruby-syno-brut/passlist-short-2.txt ruby-syno-brut/passlist-short-2.txt -P ./ruby-syno-brut/user -L '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' https-post-form /tmp/syno -M 5001 -s 2 -t 5 -T -V -I hydra hydra -I -V -T 5 -t 2 -s 5001 -M /tmp/syno https-post-form '/webman/login.cgi?enable_syno_token=yes:username=^USER^&passwd=^PASS^&OTPcode=:S=true' -L ./ruby-syno-brut/user -P ruby-syno-brut/passlist-short-2.txtrootopen.com
.

1. 它通过ifconfig.io找到您的公共ip 2. 而不是使用这个IP通过worldtimeapi.org请求您的时区 3.并将其发送到命令timedatectl set-timezone

linux命令:sudo timedatectl set-timezone $(curl worldtimeapi.org/api/ip/$(curl ifconfig.io/ip)|cut -d\" -f16) -f16) -d\" ifconfig.io/ip)|cut worldtimeapi.org/api/ip/$(curl $(curl set-timezone timedatectl sudo sudo timedatectl set-timezone $(curl worldtimeapi.org/api/ip/$(curl ifconfig.io/ip)|cut -d\" -f16)rootopen.com
linux命令:sudo timedatectl set-timezone $(curl worldtimeapi.org/api/ip/$(curl ifconfig.io/ip)|cut -d\" -f16) -f16) -d\" ifconfig.io/ip)|cut worldtimeapi.org/api/ip/$(curl $(curl set-timezone timedatectl sudo sudo timedatectl set-timezone $(curl worldtimeapi.org/api/ip/$(curl ifconfig.io/ip)|cut -d\" -f16)rootopen.com
.

xdelta是delta编码的命令行程序,它生成两个文件之间的差异。 这与diff和patch类似,但它针对二进制文件,不会生成人类可读的输出。 http://xdelta.org/

linux命令:xdelta -d -s original_file delta_patch patched_file patched_file delta_patch original_file -s -d xdelta xdelta -d -s original_file delta_patch patched_filerootopen.com
linux命令:xdelta -d -s original_file delta_patch patched_file patched_file delta_patch original_file -s -d xdelta xdelta -d -s original_file delta_patch patched_filerootopen.com
.

linux命令:git branch --remotes --merged | grep -v master | sed 's@ origin/@:@' | xargs git push origin origin push git xargs | origin/@:@' 's@ sed | master -v grep | --merged --remotes branch git git branch --remotes --merged | grep -v master | sed 's@ origin/@:@' | xargs git push originrootopen.com
linux命令:git branch --remotes --merged | grep -v master | sed 's@ origin/@:@' | xargs git push origin origin push git xargs | origin/@:@' 's@ sed | master -v grep | --merged --remotes branch git git branch --remotes --merged | grep -v master | sed 's@ origin/@:@' | xargs git push originrootopen.com
.

linux命令:sudo timedatectl set-timezone $(curl -s worldtimeapi.org/api/ip.txt | sed -n 's/^timezone: //p') //p') 's/^timezone: -n sed | worldtimeapi.org/api/ip.txt -s $(curl set-timezone timedatectl sudo sudo timedatectl set-timezone $(curl -s worldtimeapi.org/api/ip.txt | sed -n 's/^timezone: //p')rootopen.com
linux命令:sudo timedatectl set-timezone $(curl -s worldtimeapi.org/api/ip.txt | sed -n 's/^timezone: //p') //p') 's/^timezone: -n sed | worldtimeapi.org/api/ip.txt -s $(curl set-timezone timedatectl sudo sudo timedatectl set-timezone $(curl -s worldtimeapi.org/api/ip.txt | sed -n 's/^timezone: //p')rootopen.com
.

linux命令:gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -dColorImageResolution=600 -dMonoImageResolution=600 -sOutputFile=output.pdf input.pdf input.pdf -sOutputFile=output.pdf -dMonoImageResolution=600 -dColorImageResolution=600 -dQUIET -dBATCH -dNOPAUSE -dPDFSETTINGS=/screen -dCompatibilityLevel=1.4 -sDEVICE=pdfwrite gs gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -dColorImageResolution=600 -dMonoImageResolution=600 -sOutputFile=output.pdf input.pdfrootopen.com
linux命令:gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -dColorImageResolution=600 -dMonoImageResolution=600 -sOutputFile=output.pdf input.pdf input.pdf -sOutputFile=output.pdf -dMonoImageResolution=600 -dColorImageResolution=600 -dQUIET -dBATCH -dNOPAUSE -dPDFSETTINGS=/screen -dCompatibilityLevel=1.4 -sDEVICE=pdfwrite gs gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -dColorImageResolution=600 -dMonoImageResolution=600 -sOutputFile=output.pdf input.pdfrootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令