Is it possible to do netstat for remote Linux system without password?

293 Views Asked by At

Help me with the shell script for the remote system to check the TCP connection.

1

There are 1 best solutions below

2
nino On

In the remote, add your user to the wheel group:

sudo useradd -mG wheel -s /bin/bash $USER

Then, open sudoers file:

sudo vim /etc/sudoers

Add this line:

%wheel ALL=(ALL) NOPASSWD: <command>

where you replace <command> with the actual command you desire. I'm not sure if a logout is needed for it to take effect.