Skip to main content

Posts

Showing posts from 2026

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...