>> Suppose my scripts needs the profile to run at the beginning. I am not sure what "profile" you mean - in the context of SSH there is no such concept. If you mean the ".profile" file (or something similar) that "runs" automatically when you login, then it depends on the definitions of your shell. Basically, when you open an SSH "shell" channel, the SSH server usually runs the same startup files as a regular login (though this behavior can be modified).Note that this holds only or Linux servers - other O/S-s and/or other servers (e.g., MINA SSHD itself) might behave differently
>> What is the best way to do this (running the profile) only once. Can I ran it per my session creation once, and it will affect all my channels ? There is no such thing as "running a profile per session" (assuming I understood correctly your meaning). Can I have one channel during my whole app 'work' until stopped. Instead of opening a channel per each command ? This seems like the way to go - but only if you use a "shell" interactive channel. Running single commands is "stateless" - the server will forget any "state" you may have established via the profile
