Linux - samuel-richardson/Sam-Tech-Journal GitHub Wiki
Linux Configuration
Networking(configure the static IP address.)
- Detailed info found here
- Navigate to /etc/sysonfig/network-scripts.
- Edit ifcfg-interfacename(this is ens192 in the centos VM). Change or add the following fields as specified.
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.0.5.3(New address for linux box)
PREFIX=24(Subnet)
GATEWAY=10.0.5.2(ip of gateway FW)
DNS1=10.0.5.5(ip of DNS server)
DOMAIN=samuel.local(The domain name sent up earlier.)
- Restart network
systemctl restart network
- Test connectivity. ping outside domain and hostnames in the network.
Adding a privileged user.
- add user
useradd username
- change password
passwd username
- add user to group
usermod -g group username
Add Linux to DNS
- On ad go to DNS manager and add a new A or AAAA host to the local domain.
Remote access via SSH.
ssh username@dhcp01-samuel
- Get root privileges with
sudo
,sudo su
,sudo -i
. sudo -i
is best practice- Command history can be seen with the
history
command
Important Linux Commands
cp
copy filesmv
move filesless
like cat but provides a scrolling interface.rm
delete something.touch
create empty fileshead -n n filename
display a specified number lines at the top of a file.tail -n n filename
display a specified number lines at the bottom of a file.chmod
used to change file permissions