Article 5SVXE log in via ssh, execute a command after success, and stay connected

log in via ssh, execute a command after success, and stay connected

by
lleb
from LinuxQuestions.org on (#5SVXE)
Title sums things up rather well.

I want to ssh into my TrueNAS server (yes that is BSD sorry, but close enough), after I am successfully logged in I want to execute Code:source ./AL.sh and remain logged into the server in a usable mode.

I have seen the syntax Code:ssh -t user@IP command and Code: ssh -t user@IP 'command' as well as combining commands with both the pipe and ;.

All of those options log in, execute the command, than log back out. I have see adding bash -l at the end of a chain of commands, but that locks the terminal without a courser so it is not active and usable.

thanks in advancelatest?d=yIl2AUoC8zA latest?i=9VGjAj4otic:TPkyDrcUTQM:F7zBnMy latest?i=9VGjAj4otic:TPkyDrcUTQM:V_sGLiP latest?d=qj6IDK7rITs latest?i=9VGjAj4otic:TPkyDrcUTQM:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments