Hi,
I am writing a script that will be part of a jail flavour...
What I want to do is to add the host IP to /etc/ssh/sshd.conf so it only listen to that IP.
So far I managed to find the IP address using the script bellow:
This script return
How can I get rid of the 'inet' and the netmask so I am left with only the IP?
Thank you in advance
I am writing a script that will be part of a jail flavour...
What I want to do is to add the host IP to /etc/ssh/sshd.conf so it only listen to that IP.
So far I managed to find the IP address using the script bellow:
Code:
#!/bin/sh
#
# Test ssh listen address swap
test1=$(ifconfig | grep 'inet')
echo "ListenAddress $test1"
Code:
ListenAddress inet 10.5.20.15 netmask 0xffffffff
How can I get rid of the 'inet' and the netmask so I am left with only the IP?
Thank you in advance