<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linux &#8211; Giovanni F. Mazzeo De Santolo</title>
	<atom:link href="https://desantolo.com/tag/linux-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://desantolo.com</link>
	<description>That italian IT guy</description>
	<lastBuildDate>Sun, 11 Apr 2021 08:33:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
<site xmlns="com-wordpress:feed-additions:1">123042357</site>	<item>
		<title>Linux IPv6 command cheatsheet</title>
		<link>https://desantolo.com/2021/03/linux-ipv6-command-cheatsheet/</link>
					<comments>https://desantolo.com/2021/03/linux-ipv6-command-cheatsheet/#respond</comments>
		
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Fri, 05 Mar 2021 05:02:14 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[dhclient]]></category>
		<category><![CDATA[ip route]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netstat]]></category>
		<guid isPermaLink="false">https://desantolo.com/?p=596</guid>

					<description><![CDATA[Good articles about IPv6: IPv6 range blocks IPv6 unicast, anycast, multicast &#8211; well known addresses. Troubleshooting tools: IPv6 ping from multiple locations. Bonus section &#8216;ufw&#8217; firewall Check status of firewall and enable or disable.# ufw status# ufw enable# ufw disable &#8230; <a href="https://desantolo.com/2021/03/linux-ipv6-command-cheatsheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>This post is intended to be a quick note to self on linux IPv6 commands, for quick reference when needed.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>



<pre class="wp-block-code"><code># Find the route decision for a given address.
ip route get 2a00:1450:4001:820::200e

ip -6 route
route -A inet6 (apt-get install net-tools) # equivalent to netstat -rn -A inet6
netstat -A inet6 -rn
netstat -r
ip -6 route show table 51820
ip -6 neigh
ip -6 neigh show proxy

# DHCPv6 release / renew
dhclient -6 -r ens18
dhclient -6 ens18

# Flush IPv6 neighbors cache
ip -family inet6 neigh flush any

# Find the route decision for a given address.
ip route get 2a00:1450:4001:820::200e

# Request a router advertisement (apt-get install -y ndisc6)
rdisc6 eth0

# Perform a Neighbor Solicitation (arp IPv4 equivalent) (apt-get install -y ndisc6)
ndisc6 2001:db8::42 eth0

# ping multicast address to have all link-local hosts to respond.
ping ff02::1%eth0</code></pre>



<p>Good articles about IPv6:</p>
<ul>
<li><a href="https://www.mediawiki.org/wiki/Help:Range_blocks/IPv6">IPv6 range</a> blocks</li>
<li><a href="https://menandmice.com/blog/ipv6-reference-multicast">IPv6 unicast, anycast, multicast</a> &#8211; well known addresses.</li>
</ul>
<p>Troubleshooting tools:</p>
<ul>
<li><a href="https://tools.keycdn.com/ipv6-ping">IPv6 ping</a> from multiple locations.</li>
</ul>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<h2 class="wp-block-heading">Bonus section &#8216;ufw&#8217; firewall</h2>



<p>Check status of firewall and enable or disable.<br># ufw status<br># ufw enable<br># ufw disable</p>



<p>View firewall rules and number to delete a specific rule.<br># ufw status verbose<br># ufw status numbered</p>



<p>Delete a firewall rule (from number of last cmd)<br># ufw delete 12</p>



<p>Rules needed to allow IPv6 routing via wireguard to endpoint (no iptables forwarding would be needed on IPv6 as the other peer carries the public IP &#8211; they also should implement a firewall before using the below command!)<br># ufw route allow in on eth0 out on wghub to 2602:xxx:730b:xxx:cafe::12</p>



<p>IPv4 firewall and routing rule to open Plex Media Server port 32400 and internal IPv4 space of wireguard peer.<br># ufw allow in on eth0 out on wghub to 10.100.100.11 port 32400<br># ufw route allow in on eth0 out on wghub to 10.100.100.11 port 32400</p>



<p>Add rule and get logs for matches of that rule:<br># ufw allow log proto any from any to 192.168.1.x</p>



<p>View logs:<br># tail -f /var/log/ufw.log</p>



<h3 class="wp-block-heading">Extra bonus iptables NAT forwarding</h3>



<p>On VPS (public endpoint) forward IPv4 traffic on tcp/32400 to wireguard peer. (recall IPv6 doesn&#8217;t need a rule)<br># iptables -A PREROUTING -t nat -i eth0 -p tcp &#8211;dport 32400 -j DNAT &#8211;to 10.100.100.11:32400</p>



<h3 class="wp-block-heading">Test your port forwards</h3>



<p>For IPv6 I use:<br><a href="http://www.ipv6scanner.com/cgi-bin/main.py">http://www.ipv6scanner.com/cgi-bin/main.py </a></p>



<p>For IPv4:<br><a href="https://www.yougetsignal.com/tools/open-ports/">https://www.yougetsignal.com/tools/open-ports/</a><br></p>
</div>
</div>
</div>
</div>
</div></div>
</div>
</div>


]]></content:encoded>
					
					<wfw:commentRss>https://desantolo.com/2021/03/linux-ipv6-command-cheatsheet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">596</post-id>	</item>
		<item>
		<title>LXC allow non-root users to bind to port 80 (couchpotato example)</title>
		<link>https://desantolo.com/2017/06/lxc-allow-non-root-users-to-bind-to-port-80-couchpotato-example/</link>
		
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Thu, 29 Jun 2017 08:37:42 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[authbind]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[couchpotato]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://desantolo.com/?p=541</guid>

					<description><![CDATA[A follow-up to my last post dealing with unprivileged port access on linux containers. This time, I have a couchpotato container that I want to change its default port from 5050 to port 80, so that it is as simple &#8230; <a href="https://desantolo.com/2017/06/lxc-allow-non-root-users-to-bind-to-port-80-couchpotato-example/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>A follow-up to my last post dealing with unprivileged port access on linux containers.</p>
<p>This time, I have a couchpotato container that I want to change its default port from 5050 to port 80, so that it is as simple as http://mycouch/ to access from the local network.<br />
<span id="more-541"></span><br />
Since CouchPotato is a python script, my other method of whitelisting the binary won&#8217;t work, an alternative is to use <strong>authbind</strong> to get around this by granting a user/group privileges to bind to one of those restricted ports (non-root can&#8217;t bind to ports 1024 or less).</p>
<p><strong>Environment:</strong> LXC Container (Debian 9.0 Stretch) image, with couchpotato defaults running on port 5050 and systemd init script setup (couchpotato user is named gmedia)</p>
<p><code>#  groupadd -g 3200 gmedia</code><br />
<code># useradd -u 3200 -g gmedia -M gmedia</code><br />
<code># apt-get install authbind</code><br />
<code># touch /etc/authbind/byport/80</code><br />
<code># chown gmedia /etc/authbind/byport/80</code><br />
<code># chmod 500 /etc/authbind/byport/80</code></p>
<p>Now edit the startup settings (Exec/user/group):<br />
<strong><span style="color: #444444;"># nano /etc/systemd/system/couchpotato.service</span></strong></p>
<p>Should look something like this:</p>
<p><code>[Unit]</code><br />
<code>Description=CouchPotato application instance</code><br />
<code>After=network.target</code></p>
<p><code>[Service]</code><br />
<code>ExecStart=/usr/bin/authbind --deep /opt/CouchPotatoServer/CouchPotato.py</code><br />
<code>Type=simple</code><br />
<code>User=gmedia</code><br />
<code>Group=gmedia</code></p>
<p><code>[Install]</code><br />
<code>WantedBy=multi-user.target</code></p>
<p>Now its time to test:</p>
<p># systemctl daemon-reload<br />
# systemctl start couchpotato.service<br />
# systemctl status couchpotato.service</p>
<p>Confirm all is hunky dory.</p>
<p><code>root@couchpotato:~# systemctl status couchpotato.service</code><br />
<code>● couchpotato.service - CouchPotato application instance</code><br />
<code> Loaded: loaded (/etc/systemd/system/couchpotato.service; enabled; vendor preset: enabled)</code><br />
<code> Active: active (running) since Thu 2017-06-29 08:35:32 UTC; 2s ago</code><br />
<code> Main PID: 1203 (python)</code><br />
<code> Tasks: 9 (limit: 4915)</code><br />
<code> CGroup: /system.slice/couchpotato.service</code><br />
<code> └─1203 python /opt/CouchPotatoServer/CouchPotato.py</code></p>
<p><code>Jun 29 08:35:32 couchpotato systemd[1]: Started CouchPotato application instance.</code><br />
<code>root@couchpotato:~# lsof -i :80</code><br />
<code>COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME</code><br />
<code>python 1203 gmedia 49u IPv4 6008724 0t0 TCP *:http (LISTEN)</code><br />
<code>python 1203 gmedia 52u IPv4 6024843 0t0 TCP 192.168.200.140:http-&gt;192.168.200.5:56928 (ESTABLISHED)</code><br />
<code>root@couchpotato:~#</code></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">541</post-id>	</item>
		<item>
		<title>SecureCRT mapping &#8220;Page Up&#8221; and &#8220;Page Down&#8221; for Nano/SSH</title>
		<link>https://desantolo.com/2010/06/securecrt-mapping-page-up-and-page-down-for-nanossh/</link>
					<comments>https://desantolo.com/2010/06/securecrt-mapping-page-up-and-page-down-for-nanossh/#respond</comments>
		
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Wed, 23 Jun 2010 02:21:55 +0000</pubDate>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[securecrt]]></category>
		<category><![CDATA[ssh]]></category>
		<guid isPermaLink="false">http://gioflux.wordpress.com/?p=24</guid>

					<description><![CDATA[If you use a windows ssh terminal client, or even macosx’s terminal.app, the functionality of your page up and page down key may not behave like you want it to. For example, in SecureCRT using pageup will actually page up &#8230; <a href="https://desantolo.com/2010/06/securecrt-mapping-page-up-and-page-down-for-nanossh/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>If you use a windows ssh terminal client, or even macosx’s terminal.app, the functionality of your page up and page down key may not behave like you want it to. For example, in SecureCRT using pageup will actually page up your scroll buffer, and pagedown will scroll down your page buffer.</p>
<p>You’ll need to remap your keys to send the correct signal to your terminal. Change it from the default system function to “send string” and the following strings:</p>
<p>PageUp = 33[5~<br />
PageDown = 33[6~</p>
<p>33 is a shortcut for the ESCAPE key (esc) since in some programs you can’t type in the actualy escape key.</p>
<p>Here are some other codes as well in case you need to remap keys.</p>
<p>Pause = 32<br />
Macro = 03 # Break (Shift-Pause)<br />
Home = 33[1~<br />
Insert = 33[2~<br />
Remove = 33[3~ # Delete<br />
End = 33[4~</p>
<p>In SecureCRT the area to remap your keys is Tools -&gt; Keymap Editor.</p>
<p>This is especially handy if you use command line IRC clients such as Irssi or BitchX.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://desantolo.com/2010/06/securecrt-mapping-page-up-and-page-down-for-nanossh/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">24</post-id>	</item>
	</channel>
</rss>
