On Tue, 2020-06-23 at 16:19 +0000, V Sidnal, Nagraju wrote: > Dear All, > > As LibSSH supports both, Interactive(PTY) and non-interactive > approach to EXECUTE command on remote server/Machine. > I would like to know when to opt for Interactive or Non-interactive.? > On what basis, we need to decide which one to opt for? What are the > pro and cons?
If you use interactive PTY, you will need to communicate with the remote terminal and interpret terminal control characters, which are in really useful only for interactive shell sessions. If you are interested only in running some command and getting text outputs, you should be fine without PTY. Note, that some application require interactive sessions (for example openssh password prompts or sudo prompts), generally to have better confidence that user is really requesting that action, but it is probably not your case. Regards, -- Jakub Jelen Senior Software Engineer Security Technologies Red Hat, Inc.