Results 1 to 2 of 2
is it possible to execute command and terminate session all in one phrase
something like this
connect to server hostname and than execute command "ls" and than some command
ssh ...
- 01-13-2011 #1Just Joined!
- Join Date
- Aug 2010
- Posts
- 4
ssh exec command and exit session
is it possible to execute command and terminate session all in one phrase
something like this
connect to server hostname and than execute command "ls" and than some command
ssh username"at"hostname ls "something"
without "something" this phrase connects to server and lists directory, I need something that after listing directory, terminates session.
- 01-13-2011 #2
It actually should terminate the session immediately after running ls. If not, just add exit:
Code:ssh user@example.com "ls /foo/bar; exit"
Refining Linux Advent calendar: “24 Outstanding ZSH Gems”


Reply With Quote