CentOS 7 Combined Reference
(Useful for SEC260 and SYS255 and SYS265)
From SEC 260
dhclient
- to use DHCP to request an ip address- Firewall:
firewall-cmd --permanent --add-port=80/tcp
- Example for adding port 80 over TCP (otherwise known as HTTP)firewall-cmd --reload
- Reload config to apply changesfirewall-cmd --query-port=80/tcp
- Query if port 80 is open
ip addr
- Show interface ip addressesvi
- Silly editornano
- Slightly less silly editorsystemctl restart ...
- Restart a running service (likehttpd
, orsshd
)
From SYS 255
nmtui
- Edit network settings for interfaces managed by NetworkManager (likeeth0
)adduser <username>
- Add a new user (and home directory)useradd -m <username>
- Add a new user (and home directory) (for more options seeuseradd --help
orman useradd
)passwd <username>
- Set the password for a userusermod -aG wheel <username>
- Add a user to the wheel group (for more options seeusermod --help
orman usermod
)history | head -n 10
- Show the first 10 entriessystemctl start ...
- Start a service (likedhcpd
orsshd
)systemctl enable ...
- Enable a service to auto-start on bootchown USER:GROUP ...
- Change the owner (and group if specified) of given file/directorychmod PERMS ...
- Set the permissions of file/dir toPERMS
, described in this assignmentgroups
- Show groups your user is a member ofsu ...
- (S)witch (U)ser, defaults toroot
if not specified.
Manual Page Tags
man hier
- Show the manual page for the filesystem layout
Package Commands:
yum install ...
- Install packageyum update
- Sync reposyum upgrade
- Install newer versions over current versions
Package Names
httpd
- Apache2, for some reasonmod_ssl
- Apache2 SSL functionalitymod_security
- Apache2 mod securitymod_security_crs
- Rule sets for Apache2 mod securitynet-snmp-utils
- SNMP tools/services
Paths
/etc/pki/tls/{certs,private}
- for SSL certs