Skip to main content

Posts

Showing posts from 2026

Newly built Linux box cannot SSH

Fully functional and brand new built VM, Physical server, Container or any boxes with Linux distro, however, SSH is not working. Newly built Linux boxes with Server OS, the SSH service or remote access to the box won't start functioning even though the server is up and running. For the SSH to start it needs to have the required SSH keys for the service to start. The solution is to run this command: ssh-keygen -A After typing the command, try systemctl start ssh or systemctl start sahd Also check the status by: systemctl status ssh / systemctl status sshd And also good idea to start SSH once the system is restarted. Type: systemctl enable ssh / systemctl enable sshd Once the service or status of the SSH is confirmed running, then the system or device can connect remotely or other devices can connect to the local system as well. That's it, till next time. Enjoy exploring the Linux World! Prayer connect us to God, line is never congested! Have Faith and Trust Jesus, He always do g...

Linux check internet connection

Setting up any system, laptop, desktop, server, virtual machines or containers one of the requirements is for the device or machine to be able to connect to other systems or other networks like the internet. And having a working gateway, as it.is called in networking is the key that the machine is able to connect to ther internet or other devices. In Linux, a simple command type on the terminal like: - ip r  - or type the whole command: ip route This will show a message something like: default via 192.168.1.1 dev eth0 proto kernel 192.168.1.1 is the gateway IP address and if.everything is in place correctly then the system can connect to internet. Other way to verify via command line is to type: $ ip route get 8.8.8.8 Which will show an output like: 8.8.8.8 via 192.168.1.1 dev eth0 sec 192.168.1.24 uid 1000    cache Shows that packet destined for 8.8.8.8 will be routed via the gateway 192.168.1.1 Source IP will be 192.168.1.24 and UID 1000 is the id of the user executing ...

Linux variables to get UID/GID

User ID(UID), GID (Group ID) in Linux are numerical identifiers to set access to files, directories and system resources, just like rwx which in octal equivalent is r=4, w=2, x=1 and the desperate permission which will equal to 777.  777 is quite useful when nothing is working and an easy way out but yes use sparingly. UID and GID can be used also to restrict permissions or access. Quite a few ways to get UID value for the current login user. At terminal typing: echo "$UID" id -u echo/run/user/$UID All commands above are the same, get the user id of the currently logged in user. To get the GID, or the group membership of the currently logged in user is quite straight forward, at terminal type: id The output will be the  group-id(name of the group) and those are the group membership of the currently logged in user. id -Gn will just list the groups without the GID. id -G will just list the GIDs without name group Another quite useful variable, if let's say someone is asking...