Please enable JavaScript.
Coggle requires JavaScript to display documents.
Ubuntu (CHECK ADMIN (grep -Po '^sudo.+:\K.$' /etc/group
grep '…
Ubuntu
CHECK ADMIN
grep -Po '^sudo.+:\K.$' /etc/group
grep '^sudo:.$' /etc/group | cut -d: -f4
getent group sudo | cut -d: -f4
-
add to sudoers:
- visudo or /etc/sudoers
modified: add lines
loginname ALL=(ALL) ALL
CHECK PORT
You can check if a process listens on a TCP or UDP port with netstat -tuplen.
To check whether some ports are accessible from the outside (this is probably what you want) you can use a port scanner like Nmap from another system. Running Nmap on the same host you want to check is quite useless for your purpose.<link: https://serverfault.com/questions/309052/check-if-port-is-open-or-closed-on-a-linux-server>
netstat -an | grep PORTNUMBER | grep -i listen If the output is empty, the port is not in use.
-
TASK LIST
- tasklist /v - equivalent to ps aux
- taskkill /f /im ncover - equivalent to kill -9 ncover
link: http://technet.microsoft.com/en-us/sysinternals/default.aspx
find and list all running services
- service command – list running services
- service --status-all [| {[more]|[grep ntpd][less]]
- Print the status of any service
- List all known services (configured via SysV)
- Turn on / off service
ntsysv
chkconfig service off
chkconfig service on
chkconfig httpd off
chkconfig ntpd on
- To list systemd services on CentOS/RHEL 7.x+ use
systemctl
systemctl | more
systemctl | grep httpd
systemctl list-units --type service
systemctl list-units --type mount
- LIST ALL: systemctl list-unit-files
- To view processes associated with a particular service (cgroup), you can use the systemd-cgtop command. Like the top command, systemd-cgtop lists running processes based on their service:
systemd-cgtop
- To list SysV services only on CentOS/RHEL 7.x+ use (does not include native systemd services)
chkconfig --list
-
-
SEARCH
sudo find / -type f -name php.ini
$ find . -name tecmint.txt
$ find /home -name tecmint.txt
$ # find /home -iname tecmint.txt
$ # find / -type d -name Tecmint
$ find . -type f -name tecmint.php
$ find . -type f -name ".php"
$ find . -type f -perm 0777 -print
$ find / -type f ! -perm 777
$ find / -perm 2644
$ find / -perm 1551
$ find / -perm /u=s
$ find / -perm /g=s
$ find / -perm /u=r
$ find / -perm /a=x
$ find / -type f -perm 0777 -print -exec chmod 644 {} \;
$ find / -type f -perm 0777 -print -exec chmod 644 {} \;
$ find / -type d -perm 777 -print -exec chmod 755 {} \;
$ find . -type f -name "tecmint.txt" -exec rm -f {} \;
$ find . -type f -name ".txt" -exec rm -f {} \;
$ find /tmp -type f -empty
$ find /tmp -type d -empty
$ find /tmp -type d -empty
$ find /tmp -type f -name "."
$ find / -user root -name tecmint.txt
$ find /home -user tecmint
$ find /home -group developer
$ find /home -user tecmint -iname ".txt"
$ find / -mtime 50
$ find / -atime 50
$ find / -mtime +50 –mtime -100
$ find / -cmin -60
$ find / -mmin -60
$ find / -amin -60
$ find / -size 50M
$ find / -size +50M -size -100M
$ find / -size +100M -exec rm -rf {} \;
$ find / -type f -name *.mp3 -size +10M -exec rm {} \;
[https://www.tecmint.com/35-practical-examples-of-linux-find-command/]
-
SSH Config:
/etc/ssh/sshd_config
- Restart:
sudo systemctl restart sshd.service (new)
sudo service ssh restart (old)
-