0

This question already has an answer here:

I have OpenSuse 15.1 "Magic Leap" installed.

I noticed that there seems to be two conflicting commands named ss.

When I run which ss, I get this:

/usr/sbin/ss

And when I try to inspect, notice this...

>* whatis ss
ss (8)               - another utility to investigate sockets

Which to me looks like the iproute2 command I expect - a modern replacement to netstat and the like. However, attempts to use this said command to for example list all active tcp connections on the machine show that the command in my default namespace is different!

See what happens with ss -t

>* ss -t
su: invalid option -- 't'
Try 'su --help' for more information.

Which to me looks like ss is now an alias for su, the super user util.

So, is this an OpenSuse "feature", bug or what?

Also, invoking the command from an unprivileged shell automatically summons sudo and leaves me on a root shell - further hinting at the later possibility!

I don't wish to install a deprecated netstat if there's a new, modern way to do things, but then, how do I get to the proper ss command?


UPDATE:

As per muru's suggestion, here's the output of type -a

>* type -a ss
ss is aliased to `sudo su'
ss is /usr/sbin/ss
ss is /usr/bin/ss

Further, upon inspection with file, I find that these two "versions" of ss reported above, actually are the same. See the following...

>* file /usr/bin/ss
/usr/bin/ss: symbolic link to ../sbin/ss
>* file /usr/sbin/ss
/usr/sbin/ss: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=4cb972d442c793ac1783b508f94e7aaceaf83088, stripped
>* /usr/sbin/ss --version
ss utility, iproute2-ss170705

So, at the same time, ss seems to be an alias for sudo su, yet upon inspection, seems to be the iproute2 command. Weird.

marked as duplicate by Gilles 'SO- stop being evil', muru, Fabby, elbarna, telcoM Jun 26 at 3:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    Add the output of type -a ss, please. – muru Jun 23 at 13:09
  • 2
    And now use methods in unix.stackexchange.com/q/322459/70524 to see where that alias is set (chances are, openSUSE didn't) – muru Jun 23 at 14:39
  • 1
    @muru, thanks! Trying @thrig's proposal to check with bash -ixlc : 2>&1 | grep ss showed I had defined an alias ss in my bash.bashrc.local a long while ago ;-) I've now made the update, and it's now fine. – nemesisfixx Jun 23 at 14:56
  • 3
    As a side note, sudo su is a strange command to use anyway. It translates as "Hello sudo, please can I have root ... ah thankyou. Now then, hello su. Although I'm now already root, please can I have root ... thank you". There is no need for the su because at that point you are already root. Perhaps you intended sudo -s? – roaima Jun 23 at 15:18
  • 1
    @nemesisfixx Please post that as an answer! – filbranden Jun 23 at 15:19
1

Alright, I followed the suggestions of @muru, and after trying @thrig's proposal to check with bash -ixlc : 2>&1 | grep ss found I had defined an alias ss in my /etc/bash.bashrc.local a long while ago - a curious

alias ss="sudo su"

which, as @roima hilariously pointed out, was likewise overkill ;-) I've now made the necessary update to my local bashrc, and I get the correct ss.

Thanks guys!

Not the answer you're looking for? Browse other questions tagged or ask your own question.