Install netcat with
sudo apt install netcat
or on RedHat based systems
yum install netcat
The below command will scan all the ports up to 1000. Change if needed.
nc -v -z 192.168.1.20 1-1000
Install netcat with
sudo apt install netcat
or on RedHat based systems
yum install netcat
The below command will scan all the ports up to 1000. Change if needed.
nc -v -z 192.168.1.20 1-1000
Open your Oxidized config
vi .config/oxidized/config
Now edit your groups to include the following, part in bold is what specifies the SSH port. Note it needs to have the vars: line above it.
groups:
routeros:
username: admin
password: password
vars:
ssh_port: 2222
Save and quit with esc+:wq and run Oxidized
The commands are for CentOS, but should work on Fedora and RedHat.
If semanage is not installed refer to here.
You would typically use this along with the systems firewall to allow a port through. Guide for firewalld and iptables. If you change it in the firewall and fail to add/edit it in semanage you can potentially get weird behavior like sshd not wanting to start after changing the port.
Add port
semanage port -a -t ssh_port_t -p tcp 2222
The above command allows the sshd service to start, using port 2222.
List allowed ports
semanage port -l
You can use grep to filter the results
Example:
[admin@localhost ~]# semanage port -l | grep ssh ssh_port_t tcp 2222, 22 [admin@localhost ~]#
Delete port
semanage port -d -p tcp 2222
Other examples
Allow SNMP
semanage port -a -t snmp_port_t -p udp 161