Versuchen Sie es mit einem Python-Tool vielleicht, mit dem Sie sehen können, was passiert, wenn Sie einen Befehl ausführen.
Es scheint, dass Sie im Voraus nach Dateivorgängen wie dem Erstellen, Löschen, Verschieben und Ändern von Berechtigungen suchen können, indem Sie Befehle ausführen.
** Vorsichtsmaßnahmen **
That being said, maybe should :warning: NEVER :warning: be used to run untrusted code on a system you care about!
A process running under maybe can still do serious damage to your system because only a handful of syscalls are blocked.
Currently, maybe is best thought of as an (alpha-quality) "what exactly will this command I typed myself do?" tool.
Mit pip installieren
# pip install maybe
Fügen Sie einfach "vielleicht" hinzu, bevor Sie den Befehl ausführen
$ maybe COMMAND [ARGUMENT]...
$ ls
file1 file2 file3
** Datei löschen **
$ maybe rm -f ./*
maybe has prevented rm -f ./file1 ./file2 ./file3 from performing 3 file system operations:
delete /home/*******/test/file1
delete /home/*******/test/file2
delete /home/*******/test/file3
Do you want to rerun rm -f ./file1 ./file2 ./file3 and permit these operations? [y/N] y
$
Fragt, ob Sie es wirklich wollen
** Verzeichnis / Datei hinzufügen **
$ maybe mkdir test ;maybe touch test/file1
maybe has prevented mkdir test from performing 1 file system operations:
create directory /home/*******/test/test
Do you want to rerun mkdir test and permit these operations? [y/N] y
maybe has prevented touch test/file1 from performing 1 file system operations:
create file /home/*******/test/test/file1
Do you want to rerun touch test/file1 and permit these operations? [y/N] y
** Starten eines Daemons **
# maybe /etc/init.d/docker start
Starting docker:
maybe has prevented /etc/init.d/docker start from performing 26 file system operations:
write 33 bytes to /var/log/docker
create file /root/nohup.out
write 7 bytes to /var/log/docker
write 35 bytes to /var/log/docker
write 1 bytes to /var/log/docker
create file /var/run/docker.pid
write 4 bytes to /var/run/docker.pid
write 91 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 5 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 7 bytes to /root/nohup.out
write 6 bytes to /root/nohup.out
write 7 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
write 1 bytes to /root/nohup.out
Do you want to rerun /etc/init.d/docker start and permit these operations? [y/N]
Recommended Posts