<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Hubba's Blog</title>
<link>http://www.unixcook.com/BLOG/index.html</link>
<description>Notes from a Linux/Unix Engineer</description>
<language>en-GB</language>
<copyright>Copyright 2026</copyright>
<lastBuildDate>Mon, 23 Mar 2026 11:44:27 +0000</lastBuildDate>
<pubDate>Mon, 23 Mar 2026 11:44:27 +0000</pubDate>
<generator>http://thingamablog.sf.net</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>

<item>
<title>What version of SSL/TLS does my openssl support?</title>
<description>&lt;p&gt;
      This one I always have to look up as I don't use openssl very often and 
      some people say that this is the solution:
    &lt;/p&gt;
    &lt;pre&gt;                openssl ciphers -v | awk '{print $2}' | sort -u&lt;br&gt;&lt;br&gt;&lt;/pre&gt;
    &lt;p&gt;
      This is not actually correct as the second column list the minimum 
      version for a cipher. - The way you can get it from the command line is 
      using the help section from s_client with something like:
    &lt;/p&gt;
    &lt;pre&gt;               openssl s_client -help 2&amp;gt;&amp;amp;1  &amp;gt; /dev/null | egrep &amp;quot;\-(ssl|tls)[^a-z]&amp;quot;
  &lt;/pre&gt;
    &lt;p&gt;
      Now the client can also be used to explore a remote web server to see 
      what versions it supports with:
    &lt;/p&gt;
    &lt;pre&gt;               openssl s_client -connect {domain}:443 -servername {domain} -tls{version}&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
  &lt;/pre&gt;</description>
<link>http://www.unixcook.com/BLOG/archives/2026/03/what-version-of-ssltls-does-my-openssl-support.html</link>
<guid>http://www.unixcook.com/BLOG/archives/2026/03/what-version-of-ssltls-does-my-openssl-support.html</guid>

<category>HowTo</category>

<category>System - Linux</category>

<pubDate>Mon, 23 Mar 2026 10:39:34 +0000</pubDate>
</item>

<item>
<title>Extracting a user keytab for krb5 authentication without passwords.</title>
<description>&lt;p&gt;
      
    &lt;/p&gt;
    &lt;p&gt;
      
    &lt;/p&gt;
    &lt;p&gt;
      &lt;b&gt;WARNING - The keytab must be kept safe as it can be used as a key on 
      other systems!&lt;/b&gt;
    &lt;/p&gt;
    &lt;p&gt;
      
    &lt;/p&gt;
    &lt;p&gt;
      So the problem at hand is for users that do not authenticate against AD 
      and use an SSH key for like an SFTP job or for applications that run in 
      the background and the kerberos ticket expires they will no longer be 
      able to access the NFS filesystem but I have the need to encrypt the 
      filesystem. How can we keep them authenticated.
    &lt;/p&gt;
    &lt;p&gt;
      For this we use ktutil to create our own keytab (ktutil is like a shell):
    &lt;/p&gt;
    &lt;p&gt;
      Run ktutil to enter the shell
    &lt;/p&gt;
    &lt;p&gt;
      In the shell we run &amp;quot;addent -password -p &amp;lt;user&amp;gt;@&amp;lt;REALM&amp;gt; -k 2 -e 
      aes256-cts-hmac-sha1-96 -f&amp;quot; which will prompt you for the user password.
    &lt;/p&gt;
    &lt;p&gt;
      The &amp;quot;-f&amp;quot; flag may not be required but it will make sure that the &amp;quot;salt&amp;quot; 
      is the same as kinit will use.
    &lt;/p&gt;
    &lt;p&gt;
      We can use &amp;quot;list -e&amp;quot; to view the result and then write it to a file with 
      &amp;quot;wkt &amp;lt;filename.keytab&amp;gt;&amp;quot;
    &lt;/p&gt;
    &lt;p&gt;
      With &amp;quot;q&amp;quot; we can gracefully exit ktutil.
    &lt;/p&gt;
    &lt;p&gt;
      You should now be able to do a &amp;quot;kinit -kt &amp;lt;path to above created keytab&amp;gt; 
      &amp;lt;user&amp;gt;@&amp;lt;REALM&amp;gt;&amp;quot;
    &lt;/p&gt;
    &lt;p&gt;
      If that works the keytab can be placed as &amp;lt;user&amp;gt;.keytab in 
      /var/lib/gssproxy/clients/ and gssproxy will attempt to use it when that 
      UID accesses the filesystem. - &lt;b&gt;ONLY root should be able to read that 
      keytab!&lt;/b&gt;
    &lt;/p&gt;
    &lt;p&gt;
      On RHEL8 /etc/gssproxy/99-nfs-client.conf actually looks for the keytab 
      as &amp;lt;numerical UID&amp;gt;.keytab in /var/lib/gssproxy/clients/.
    &lt;/p&gt;</description>
<link>http://www.unixcook.com/BLOG/archives/2026/03/extracting-a-user-keytab-for-krb5-authentication-without-passwords.html</link>
<guid>http://www.unixcook.com/BLOG/archives/2026/03/extracting-a-user-keytab-for-krb5-authentication-without-passwords.html</guid>

<category>HowTo</category>

<category>System - Linux</category>

<pubDate>Thu, 05 Mar 2026 16:15:45 +0000</pubDate>
</item>

<item>
<title>Disk/Filesystem benchmarking</title>
<description>&lt;p&gt;
      
    &lt;/p&gt;
    &lt;p&gt;
      Note to self at the moment until I have more details on what I am 
      actually trying to prove:
    &lt;/p&gt;
    &lt;p&gt;
      To test performance on file systems I have used the following command:
    &lt;/p&gt;
    &lt;blockquote&gt;
      fio --name=rand --rw=randrw --bs=4k --iodepth=32 --numjobs=16 
      --runtime=600 --time_based --size=1G --directory=/filesystem
    &lt;/blockquote&gt;
    &lt;blockquote&gt;
      iozone -Rac -b test.xls is also something I am experimenting it but 
      don't really understand the output of that yet.
    &lt;/blockquote&gt;
    &lt;div&gt;
      
    &lt;/div&gt;
    &lt;p&gt;
      Another tool that has been around for a long time is bonnie++ but I am 
      not sure if it is still maintained
    &lt;/p&gt;
    &lt;p&gt;
      
    &lt;/p&gt;</description>
<link>http://www.unixcook.com/BLOG/archives/2025/12/diskfilesystem-benchmarking.html</link>
<guid>http://www.unixcook.com/BLOG/archives/2025/12/diskfilesystem-benchmarking.html</guid>

<category>HowTo</category>

<category>System - Linux</category>

<pubDate>Tue, 30 Dec 2025 16:23:14 +0000</pubDate>
</item>

<item>
<title>Encrypted NFS</title>
<description>&lt;p&gt;
      
    &lt;/p&gt;
    &lt;p&gt;
      After &lt;a href=&quot;/BLOG/archives/2025/06/managing-ad-computer-accounts-with-adcli-and-kerberos-on-linux.html&quot;&gt;joining 
      AD&lt;/a&gt;&amp;#160;we can use kerberos to encrypt nfs traffic as well - Obviously 
      the NFS server must be joined to the same AD domain.
    &lt;/p&gt;
    &lt;p&gt;
      To this we need to add a SPN on the server side (already explained in 
      the previously mentioned blog) to the NFS server nfs/&amp;lt;server name&amp;gt;
    &lt;/p&gt;
    &lt;p&gt;
      It needs to be visible in the keytab with klist -ke.
    &lt;/p&gt;
    &lt;p&gt;
      Then we add the export to the exports file womething like:
    &lt;/p&gt;
    &lt;pre&gt;/TEST *.localnet.lan(rw,sec=krb5:krb5i:krb5p,no_root_squash)&lt;br&gt;&lt;/pre&gt;
    &lt;p&gt;
      We only really want krb5p as that is fully encrypted.
    &lt;/p&gt;
    &lt;p&gt;
      Then we need to set the domain in /etc/idmapd.conf - It should be 
      returned when you run &amp;quot;nfsidmap -d&amp;quot; - In my case this is localnet.lan.
    &lt;/p&gt;
    &lt;p&gt;
      Most problems are about this SPN - so my SPN is nfs/server.localnet.lan 
      but and the server name is the same but my kerberos realm is 
      upnor.localnet.lan so I had to add this to my /etc/krb5.conf file that 
      is mentioned in the other blog.
    &lt;/p&gt;
    &lt;pre&gt;    
  [domain_realm]
  .localnet.lan = UPNOR.LOCALNET.LAN
  localnet.lan = UPNOR.LOCALNET.LAN
  .upnor.localnet.lan = UPNOR.LOCALNET.LAN
  upnor.localnet.lan = UPNOR.LOCALNET.LAN&lt;/pre&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      &lt;br&gt;
      I also added allow_weak_crypto - I am not sure it is required but in the 
      redhat manuals it does tell you to do that so for completeness my config 
      is now:
    &lt;/p&gt;
    &lt;pre white-space=&quot;pre&quot;&gt;    includedir /etc/krb5.conf.d/

[logging]
    default = FILE:/var/log/krb5libs.log
    kdc = FILE:/var/log/krb5kdc.log
    admin_server = FILE:/var/log/kadmind.log

[libdefaults]
    dns_lookup_realm = false
    dns_lookup_kdc = false
    ticket_lifetime = 24h
    renew_lifetime = 7d
    forwardable = true
    rdns = false
    pkinit_anchors = FILE:/etc/pki/tls/certs/ca-bundle.crt
    spake_preauth_groups = edwards25519
    default_realm = UPNOR.LOCALNET.LAN
    default_ccache_name = KEYRING:persistent:%{uid}
    allow_weak_crypto = true

[realms]
  UPNOR.LOCALNET.LAN = {
  kdc = 192.168.0.10
  }

[domain_realm]
  .localnet.lan = UPNOR.LOCALNET.LAN
  localnet.lan = UPNOR.LOCALNET.LAN
  .upnor.localnet.lan = UPNOR.LOCALNET.LAN
  upnor.localnet.lan = UPNOR.LOCALNET.LAN&lt;/pre&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      If we have done this all correctly we should be able to mount this 
      export with something like &amp;quot;mount -t nfs -o 
      nfsvers=4,sec=krb5p,proto=tcp&amp;quot; - We want krb5p as that fully encrypts 
      all traffic while krb5 and krb5i only encrypt certain parts of the 
      protocol which may be to insecure in some environments.
    &lt;/p&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      It should be noted that users have to have a kerberos ticket before they 
      can read/write files on this mount and then the normal file permissions 
      apply - However in an export the no_root_squash is actually irrelevant 
      as root may be able to read stuff using the host credentials but root 
      can not write to the file system as root can not get a kerberos ticket. 
      There are workarounds to make that work but in general they are not 
      recommended as they make your environment less secure again.
    &lt;/p&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      You may want to &lt;a href=&quot;/BLOG/archives/2025/09/enable-krb5-authentication-for-ssh.html&quot;&gt;read 
      my article&lt;/a&gt; about about ssh kerberos authentication and ticket 
      delegation.
    &lt;/p&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      Some of the errors that can be encountered are very misleading. - For 
      example I have come accross &amp;quot;an incorrect mount option was specified&amp;quot; - 
      This had nothing to do with the mount options but can mean it is an 
      error in the client configuration. - In my case the culprit was that 
      rpc-gssd.service actually had died and I needed to manually start it.
    &lt;/p&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      You may notice that the no_root_squash option does not actually work 
      with krb5. - There are various way to enable that but none are really 
      recommended or even work as they will lower the security of your setup. 
      RedHat have &lt;a href=&quot;https://access.redhat.com/articles/4040141&quot; target=&quot;_blank&quot;&gt;this 
      article&lt;/a&gt; on that which would not work for me. - The ony way I was 
      able to actually make that work with my setup is add the following to my 
      realms section on the nfs server which will enable the client host 
      linuxdev2 which will hold the host credential to be able to access 
      shares as root (HOSTNAME$ is the actual computer account in AD and only 
      root can use that to perform the initial mount):
    &lt;/p&gt;
    &lt;pre white-space=&quot;pre&quot;&gt; [realms]
  UPNOR.LOCALNET.LAN = {
  kdc = 192.168.0.10
  auth_to_local_names ={
       LINUXDEV2$ = root
    }&lt;br&gt;  }&lt;br&gt;&lt;br&gt;&lt;/pre&gt;
    &lt;p white-space=&quot;pre&quot;&gt;
      There are articles that explain how you can create a a root account 
      kerberos realm but that then means that root will also have to 
      authenticate with a password to perform the mount and mounts can not be 
      performed during boot out of fstab&lt;br&gt;
    &lt;/p&gt;</description>
<link>http://www.unixcook.com/BLOG/archives/2025/09/encrypted-nfs.html</link>
<guid>http://www.unixcook.com/BLOG/archives/2025/09/encrypted-nfs.html</guid>

<category>HowTo</category>

<category>System - Linux</category>

<pubDate>Thu, 04 Sep 2025 17:04:57 +0100</pubDate>
</item>

<item>
<title>Enable krb5 authentication for SSH</title>
<description>&lt;p&gt;
      
    &lt;/p&gt;
    &lt;p&gt;
      After &lt;a href=&quot;/BLOG/archives/2025/06/managing-ad-computer-accounts-with-adcli-and-kerberos-on-linux.html&quot;&gt;joining 
      an AD&lt;/a&gt;&amp;#160;it is very simple to enable kerberos authentication for SSH 
      assuming your Windows ID and Unix ID match. - All you need to do is add 
      the following 2 lines to /etc/ssh/sshd_config
    &lt;/p&gt;
    &lt;p&gt;
      GSSAPIAuthentication yes&lt;br&gt;GSSAPIKeyExchange yes
    &lt;/p&gt;
    &lt;p&gt;
      All you then have to do is enable these options on your ssh client and 
      you should be able to login to your Linux systems with the credentials 
      on the windows machine joined to the same domain.
    &lt;/p&gt;
    &lt;p&gt;
      You may also have to turn things on the client side depending on what 
      ssh client you use so on Linux you may need the following in your 
      .ssh/config file or in the /etc/ssh/ssh_config file if you want all 
      users to use kerberos:
    &lt;/p&gt;
    &lt;p&gt;
      GSSAPIAuthentication yes&lt;br&gt;GSSAPIDelegateCredentials yes
    &lt;/p&gt;
    &lt;p&gt;
      The delegate part is to enable kerberos ticket forwarding so when you 
      log into the system your ticket gets passed along so you can read your &lt;a href=&quot;/BLOG/archives/2025/09/encrypted-nfs.html&quot;&gt;encrypted 
      NFS&lt;/a&gt; directories for example.
    &lt;/p&gt;
    &lt;p&gt;
      The delegation part is however also controlled by the system 
      administrator so in Linux to enable this you have to add &amp;quot;forwardable = 
      true&amp;quot; to /etc/krb5.conf in the libdefaults section.
    &lt;/p&gt;
    &lt;p&gt;
      On Windows the delegation part is controlled out of the Group Policy on 
      the computer account for the machine.
    &lt;/p&gt;
    &lt;p&gt;
      It is important to understand that authenticatin with a kerberos ticket 
      will not issue a ticket on the target machine it must be delegated 
      during kerberos authentication and it will also not be delegated if you 
      are using ssh keys or other forms of authentication.
    &lt;/p&gt;
    &lt;p&gt;
      A kerberos ticket can only be optained by authenticating against 
      kerberos with a password. - On Windows this is done during login or when 
      you unlock your screen with your password. On Linux the same may be 
      enabled in pam with sssd or winbind authentication so you can get pam to 
      pass your password through to the domain when authenticating. Obviously 
      kinit is your last resort if these methods are not viable.
    &lt;/p&gt;</description>
<link>http://www.unixcook.com/BLOG/archives/2025/09/enable-krb5-authentication-for-ssh.html</link>
<guid>http://www.unixcook.com/BLOG/archives/2025/09/enable-krb5-authentication-for-ssh.html</guid>

<category>HowTo</category>

<category>System - Linux</category>

<pubDate>Thu, 04 Sep 2025 14:49:15 +0100</pubDate>
</item>

</channel>
</rss>