79792982

Date: 2025-10-17 10:27:42
Score: 1
Natty:
Report link

The difference may have to do with having an interactive session. When you run ssh in an interactive shell, you'll be connected to a TTY, but automated scripts run by cron will not. Moreover, Bash will read from ~/.bash_profile on an interactive shell and ~/.bashrc for a non-interactive one, which can lead to subtle differences in the environment.

You might try debugging ssh by adding the -vvv option and capturing the output and see what's different between the manual and cron runs. Another thing to try would be the -t option for ssh.

Other Suggestions

Truly learning a command language interpreter, especially one with as large of a manual as Bash has, can take years. In the hopes of accelerating that learning for an up-and-coming scripter, I thought I'd share these suggestions unrelated to your query:

Reasons:
  • Blacklisted phrase (1): Is it possible to
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: ColMelvin