Cease utilizing these outdated Linux instructions earlier than they trigger issues
Linux is continually evolving, and with it the instruments that its followers use every day. Nonetheless, among the classics resembling iptables , which has been changed by nftables , at the moment are not solely outdated, but additionally probably insecure or inefficient.
But they’re nonetheless referenced in lots of Linux books and on quite a few web sites. This tempts customers to proceed utilizing them.
On this article, we current essentially the most regularly encountered “deprecated“, i.e. out of date, Linux instructions. Many customers are most likely nonetheless accustomed to them. Nonetheless, for the explanations simply talked about, they’re not updated as a result of they’ve unclosed safety gaps, incomplete features, or there are extra environment friendly alternate options.
Among the outdated instructions have already been faraway from the present distributions. Nonetheless, others are nonetheless included.
The Netfilter mission not solely takes care of the basic iptables, but additionally of its successor nftables, which additionally replaces the instructions ip6tables, arptables, and ebtables.
Foundry
Software program developer and system administrator Jose Vicente Nunez, for instance, has compiled a listing of Linux instructions that ought to not be used for the Pink Hat weblog.
He additionally names alternate options which, in his opinion, supply a minimum of the identical vary of features, are nonetheless normally extra highly effective and are additionally nonetheless actively maintained.
egrep and fgrep
Nunez cites the instructions egrep and fgrep as the primary examples. They’re based mostly on the grep instrument, which particularly searches for textual content patterns in recordsdata or inputs. Nonetheless, each egrep and fgrep are not being developed additional as a result of they’ve now been built-in into grep as further parameters.
As an alternative of the stand-alone command egrep, which makes use of prolonged common expressions to search out the specified sample, now you can use
grep -E
This lets you use extra complicated patterns and particular characters with out having to masks them.
Equally, fgrep has been changed, which searches for mounted, i.e. unchanged textual content strings and thus saves time. Right this moment, the fgrep command primarily corresponds to
grep -F
In newer distributions, each egrep and fgrep are merely symbolic hyperlinks to grep.
nslookup
The nslookup command can also be not fairly updated. It was and remains to be regularly used right now to carry out DNS (Area Title System) queries.
For instance, it may be used to search out out the IP tackle for a site utilizing a ahead lookup or the area identify for an IP tackle utilizing a reverse lookup.
As well as, nslookup can be utilized to particularly question numerous DNS servers, test DNS entries or diagnose identify decision errors.

The dig command informs you that de.wikipedia.org is one other identify for dyna.wikimedia.org, shows the corresponding IP tackle and thus offers a fast overview of the DNS mapping.
Foundry
The choice to cease creating nslookup was cancelled in 2004. Nunez and plenty of others nonetheless advocate utilizing the instructions
dig
and
host
instructions.
For instance, dig is a part of the BIND DNS instruments, that are actively maintained and may due to this fact now do greater than nslookup.
The identify is without doubt one of the open supply group’s favourite puns. On the one hand, the time period “to dig” might be translated as “to dig up”, alternatively additionally it is the abbreviation for “area info groper”.
Dig helps DNSSEC, can carry out focused queries of all document sorts, delivers structured and easy-to-read output and due to this fact presents larger flexibility even for complicated queries.
As well as, not like dig, nslookup doesn’t use the working system’s native area identify system resolver library to carry out queries. Consequently, nslookup might return completely different outcomes than dig if, for instance, the resolver library takes further “hosts” recordsdata under consideration or makes use of an area cache.
ifconfig, route and netstat
The ifconfig command is without doubt one of the best-known instruments that’s not fairly updated. If this system is used with out parameters, it reveals the present community configuration. Nonetheless, it can be used to configure the community adapter along with info on the server tackle, gateway, netmask, or IP tackle.

The Linux command ifconfig is without doubt one of the hottest relics from the previous, however the different ip presents way more choices and features for exactly managing community interfaces, IP addresses, and routing.
Foundry
Most distributions nonetheless embrace ifconfig. The command ought to have been changed years in the past by the choice
ip
from the iproute2 household.
At first look, ip seems extra sophisticated than ifconfig, as a command resembling “ip addr present” is required to show the present IP tackle. As an alternative, ip offers info with a command resembling
ip hyperlink present
ip offers details about the community interfaces, resembling actual or digital community playing cards and WLAN adapters.
Additional examples of the usage of the ip command:
ip hyperlink set eth0 up
Prompts the community interface “eth0”.
ip hyperlink set eth0 down
Deactivates the community interface “eth0” once more.
ip addr present dev eth0
Reveals the IP tackle of the community interface “eth0”.
ip hyperlink present dev eth0
Reveals the main points of the community interface “eth0”.
ip addr del 192.168.0.77/24 dev eth0
This command is simply obtainable with ip, for instance. It deletes the desired IP tackle for the interface “eth0”. Along with such duties, ip additionally offers details about the routing desk:
ip route present
or
ip route listing
Right here the ip command reveals the routing desk and thus additionally replaces the route command. The “route -n” command shows the addresses in tabular type, however solely numerically and with out DNS decision. The output of “ip route present” or “ip route listing”, alternatively, is way extra compact and comprises further info.

The ip command initially seems extra sophisticated than ifconfig, however offers extra detailed details about the assorted community layers, for instance, and permits the community configuration to be managed and analyzed extra exactly.
Foundry
One other community command, which on this case is changed by the command
ss
(the abbreviation stands for “Sockets Statistics”) is netstat. The instrument reveals, for instance, the listing of lively community connections. An instance:
netstat --numeric --tcp --listen
The command lists the lively TCP connections with out identify decision. The ss equal is
ss --numeric --tcp --listen
The ss command can also be a part of the iproute2 bundle and replaces netstat on trendy programs, as it may possibly show extra particulars and in addition begins quicker.
Whereas netstat retrieves info from the “/proc” recordsdata, ss accesses the kernel instantly. In distinction to netstat, which is not an actively maintained nettool, ss is repeatedly being developed and tailored to trendy working programs and protocols.

The netstat and ss instructions each listing the lively TCP connections with out identify decision. ss works instantly with the kernel and due to this fact offers further particulars on sockets.
Foundry
The “ss” command with out additional parameters outputs a listing of all community connections.
One other of the command’s strengths is that it may possibly filter connections in line with numerous standards. For instance, “ss -t” solely lists TCP connections, whereas “ss -u” does the identical with UDP connections. To show which processes are accessing the community, use the command “ss -p”.
iwconfig
One other community command that’s now thought-about out of date for good motive is iwconfig. It’s much like ifconfig, however is designed for wi-fi adapters. It may well nonetheless be present in some distributions resembling Ubuntu. Nonetheless, others resembling Pink Hat have already eliminated it and changed it with the newer
iw
command.
It’s because iwconfig doesn’t cowl many present WLAN features and not reliably helps trendy requirements resembling 802.11ac or 802.11ax.
Iw, alternatively, is being actively developed additional, offers detailed details about community playing cards, sign strengths, frequencies and channels, permits complicated configurations, and helps all present WLAN requirements in addition to new features resembling mesh networks or WPA3.
scp
The scp command is one other basic, however its use is not advisable. One in every of its strengths is that it’s much like the well-known cp command, which can be utilized to repeat recordsdata and directories regionally on a pc.
Scp, alternatively, is used to switch encrypted knowledge over the community utilizing SSH (Safe Shell). Along with cp, scp additionally comprises features for authentication with a password or SSH key.
For instance, the command
cp report.txt /residence/consumer/backup/
copies the file “report.txt” from the present listing to a backup folder. With scp it could appear to be this:
scp report.txt consumer@server:/residence/consumer/
As an alternative of simply specifying an area path, scp requires just a few further particulars. For instance, “consumer” is the consumer on the distant system, “server” is its tackle and “/residence/consumer” is the trail to the listing to which the “report.txt” file is to be transferred.
One other distinction is that the switch solely takes place after the right password has been entered. With each variants, additionally it is doable to append a file identify to the trail. The instructions then change the unique file identify to the brand new one.
Within the article “Deprecating scp“, the creator Jonathan Corbet describes crucial explanation why scp is not being developed additional.

Jonathan Corbet explains on LWN.internet the explanation why even long-time scp customers ought to not use this system to switch recordsdata over the community.
Foundry
For instance, scp is predicated on the outdated rcp protocol, which is now classed as insecure. One other drawback, in line with Corbet, is the strategy utilized by scp to move arguments. This might result in the unintentional execution of instructions, particularly on programs on which entry is definitely restricted to easily copying knowledge by way of scp.
Pink Hat and Fedora have due to this fact determined in 2022 to not help the outdated SCP protocol by default. The scp command remains to be obtainable, however now makes use of the safer SFTP protocol internally by default (relying on the interpretation, the abbreviation stands for “Safe File Switch Protocol” or “SSH File Switch Protocol”), whereas the reference to the unique SCP protocol has been eliminated.
The explanation given by Dmitry Belyavskiy, Senior Software program Engineer at Pink Hat, is that the SCP protocol is already a long time outdated and has quite a few safety dangers and issues for which there aren’t any easy options.
The change was programmed with the involvement of Jakub Jelen, who was lively as a maintainer for the Open SSH bundle for a number of years. As a precaution, nonetheless, a form of backdoor was inbuilt.
There’s now the brand new scp change “-O”, which reactivates the outdated SCP protocol. Nonetheless, it’s more likely to be eliminated once more in one of many upcoming Pink Hat releases. Its use is due to this fact not advisable.

With the discharge of RHEL 9, Pink Hat has determined to not take away scp fully, however to switch the underlying protocol with SFTP.
Foundry
It due to this fact makes extra sense to modify to the alternate options
rsync
or
sftp
alternate options. Each additionally use SSH to securely entry distant machines. Each additionally supply extra features and, above all, are being actively developed additional.
iptables
Many Linux customers make the most of the iptables instrument for packet filtering and firewall configuration. It may be used to outline guidelines that permit, block, or redirect packets.
Nonetheless, iptables is now additionally thought-about outdated, primarily resulting from issues with scalability and efficiency.
For that reason, the Netfilter mission itself, which additionally maintains the iptables userland instrument along with the kernel subsystem, is creating
nftables
as a result of the iptables framework has turn into considerably complicated.
For instance, it’s not precisely environment friendly to create guidelines for IPv4 with iptables and for IPv6 with ip6tables with a purpose to then painstakingly synchronize them. That is simpler with nftables.
Each instructions work comparatively equally, however nftables not solely makes use of a less complicated syntax. The brand new instrument even understands the syntax of iptables. As well as, iptables- translate is one other instrument that converts iptables instructions into their nftables equal.
Conclusion: Please change!
Within the Linux world, adjustments are typically relatively cautious. Outdated utilities usually stay in use for years, even when extra trendy and safe alternate options have lengthy been obtainable. Solely after an extended time frame, typically solely after a number of years, are these older instruments steadily changed by their up to date counterparts.
Nonetheless, this course of additionally ensures stability and compatibility within the Linux group. Many aged instruments due to this fact intentionally stay within the distributions for compatibility causes, however ought to a minimum of get replaced by their extra trendy alternate options in tutorials, scripts, and new initiatives.
This text initially appeared on our sister publication PC-WELT and was translated and localized from German.

