1

I have a small shell script test.sh in Unix with the following content:

cd /usr/kerberos/sbin
echo l | ktutil
echo quit | ktutil

Its running fine in Unix and giving the output of ktutil. However when I run from Windows using the PLINK.EXE of PuTTY, its not running the ktutil command properly. The output it gives is the usage of ktutil.

Usage: ktutil [-hv] [--version] [--help] [--keytab=keytab to operate on] [-k keytab to operate on] [--verbose] command -k keytab to operate on, --keytab=keytab to operate on keytab -v, --verbose

Usage: ktutil [-hv] [--version] [--help] [--keytab=keytab to operate on] [-k keytab to operate on] [--verbose] command -k keytab to operate on, --keytab=keytab to operate on keytab -v, --verbose

The command I use in Windows is the following:

PLINK.EXE user@server /home/user/test.sh
Nitish
  • 1,686
  • 8
  • 23
  • 42

1 Answers1

0

It is possible your environment isn't set correctly when accessing your user directly from PLINK.EXE.

Check if there is an alias for your ktutil command, from Unix:

type ktutil

A solution would be to define shell variables with the source command, e.g. at the beginning of your test.sh script:

source /home/myuser/.profile
J. Chomel
  • 8,193
  • 15
  • 41
  • 69
  • Thanks. It worked. In my script `test.sh`, I gave the full path of `ktutil`. Like `echo l | /usr/kerberos/sbin/ktutil` – Nitish Jun 30 '17 at 13:46