Network management: Difference between revisions

Jump to navigation Jump to search
Get public IP address from CLI
Get public IP address from CLI
Line 5: Line 5:
at the end of <span class="shell">/etc/samba/smb.conf</span> add a share config.
at the end of <span class="shell">/etc/samba/smb.conf</span> add a share config.


<syntaxhighlight lang="properties">
<source lang="properties">
[ea]
[ea]
         comment = pistis - echo admin
         comment = pistis - echo admin
Line 12: Line 12:
         read only = No
         read only = No
         create mask = 0755
         create mask = 0755
</syntaxhighlight>
</source>


then add the Samba account.
then add the Samba account.


<syntaxhighlight lang="bash">
<source lang="bash">
$ sudo smbpasswd -a mhan
$ sudo smbpasswd -a mhan
</syntaxhighlight>
</source>


then restart samba
then restart samba


<syntaxhighlight lang="bash">
<source lang="bash">
$ sudo systemctl restart smbd.service nmbd.service
$ sudo systemctl restart smbd.service nmbd.service
</syntaxhighlight>
</source>


then on Windows execute the following. For the username, you may have to enter it in the form <span class="package">mhan@pistis</span> or <span class="package">pistis\mhan</span>. Enter the password you used when you added the Samba account for the user.
then on Windows execute the following. For the username, you may have to enter it in the form <span class="package">mhan@pistis</span> or <span class="package">pistis\mhan</span>. Enter the password you used when you added the Samba account for the user.


<syntaxhighlight lang="doscon">
<source lang="doscon">
C:\>net use Z: \\pistis\ea /savecred /persistent:yes
C:\>net use Z: \\pistis\ea /savecred /persistent:yes
</syntaxhighlight>
</source>


== Checking the accessibility of a port through the network ==
== Checking the accessibility of a port through the network ==
Line 39: Line 39:
$ sudo hping3 -T -t 1 -p 8080 pisteo.example.com
$ sudo hping3 -T -t 1 -p 8080 pisteo.example.com
</source>
</source>


== Tracing a route ==
== Tracing a route ==
Line 45: Line 44:
<source lang="bash">
<source lang="bash">
$ traceroute pisteo.example.com
$ traceroute pisteo.example.com
</source>
== Get public IP address from CLI ==
<source lang="bash">
$ dig +short myip.opendns.com @resolver1.opendns.com
$ dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'
</source>
</source>

Navigation menu