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

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