0

When I run the mount command I’m able to connect/ls to the share until, what appears to be the ticket renewal, timing occurs. Then I get host is down.
I have looked through all the suggested similar questions and searched the web. See "a little background below"

I can’t seem to find anything in logs/journals that will tell me what happened or when.

My environments is: AWS Amazon Linux 2 AWS Active Directory with user setup to never expire AWS FSx share On the linux server I have k5start running, an fstab file, a krb5.conf file (see these below)

A little background, I have this working in another environment but can’t see to find out what is different. We hired a consultant to help set this up initially and they are not available to have help.

Our requirements were:

  1. do not join the linux machine to the AD,
  2. do not use a plan text file w/ username/password on the machine
  3. the share is be available to all processes on the machine
  4. auto-renew permissions/tickets
  5. auto mount on restart

Our configurations:

============

k5start.service file: [Unit] Description=Kerberos Credential Cache Manager Daemon for FSx Mount After=network.target Before=mnt-fsx.mount

[Service] Type=simple User=ec2-user Group=ec2-user ExecStart=/usr/bin/k5start -aLK 15 -l 1hr -f /etc/myUser.keytab “[email protected]"

[Install] WantedBy=multi-user.target

==========

fstab file: //my.fsx.myAD.aws.msad.com/share /mnt/fsx cifs vers=3.0,cache=none,user=ec2-user,cruid=ec2-user,sec=krb5,uid=1000,gid=1000,ip=myFSxIP

========== keytab file created using:

  • ktutil
  • addent -password -p [email protected] -k 1 -e RC4-HMAC 
- enter password for username -
  • wkt myUser.keytab
  • q
  • I then move the file to another location on disk and change permissions to 755

==========

Installing the prereqs: sudo yum -y install sssd realmd krb5-workstation samba-common-tools sudo yum install -y cifs-utils sudo amazon-linux-extras enable epel sudo yum install -y epel-release sudo yum install -y kstart

==========

Installing the service by: sudo systemctl daemon-reload sudo systemctl enable k5start sudo systemctl start k5start sudo systemctl status k5start -l output: k5start.service - Kerberos Credential Cache Manager Daemon for FSx Mount Loaded: loaded (/usr/lib/systemd/system/k5start.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2022-09-12 22:43:52 UTC; 24h ago Main PID: 2990 (k5start) CGroup: /system.slice/k5start.service └─2990 /usr/bin/k5start -a -L -K 15 -l 1h -f /etc/myUser.keytab [email protected]

——————————

Some commands that I’ve run to try and figure things out...

=====

if I run these two commands the mount comes back online but goes away again at interval

  • sudo umount -l /mnt/fsx
  • sudo mount -a --verbose

=====

dig myAD.AWS.MSAD.COM

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.amzn2.5.2 <<>> myAD.AWS.MSAD.COM ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30388 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4000 ;; QUESTION SECTION: ;myAD.AWS.MSAD.COM. IN A

;; ANSWER SECTION: myAD.AWS.MSAD.COM. 600 IN A 172.31.xxx.xxx myAD.AWS.MSAD.COM. 600 IN A 172.31.xxx.xxx

;; Query time: 0 msec ;; SERVER: 172.31.19.208#53(172.31.19.208) ;; WHEN: Tue Sep 13 23:27:25 UTC 2022 ;; MSG SIZE rcvd: 83

=====

klist Ticket cache: KEYRING:persistent:1000:1000 Default principal: [email protected]

Valid starting Expires Service principal 09/12/2022 22:22:46 09/12/2022 23:22:46 krbtgt/[email protected] renew until 09/19/2022 22:22:46

=======

Thank you for looking!

1 Answer 1

0

make sure that all things a set correctly:

/etc/kr5.conf is set correctly with your domain details. test that you can klist and kinit manually the user with keytab.

keytab file using ktpass.exe and not ktutil. with ktpass it will also create service principal name within the KDC run the ktpass from DC, sample ktpass:

ktpass.exe -princ CIFS/[email protected] -mapuser [email protected] -crypto All -ptype KRB5_NT_SRV_INST -pass ***** +dumpsalt -out c:\username.keytab

this will create a keytab for a user: username that have permission to the Fileserver (FS.DOMAIN.LOCAL) and will create a CIFS service principal in the keytab file for it.

k5start: on your Linux machine:

k5start -b -U -L -a -K 60 -f /full/path/to/username.keytab

-b makes it run in background.

-U uses the keytab principal name.

-L write log to /var/log/syslog.

-a hard renew each start (like kinit not like krenew).

-K sets the -a interval.

-f path of keytab, absolute path is crucial.

you can use klist to see if ticket obtain successfully.

mount:

sudo mount -t cifs --verbose -o vers=2.1,sec=krb5,[email protected] //FS.DOMAIN.LOCAL/SharedFolder/ /mnt/SharedFolder/

you can add it to /etc/fstab as well.

k5start will request new ticket every 60m. this should satisfy the mount.cifs and keep it up without providing password every time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .