I want to open a VIM instance with one user account (using su), then login as another user and access the same session with that user.
Example User1: su - user2 -c vim somefile.txt
Then I want to login as User2 and then access that VIM process created by that first user. I know it's possible but I'm not sure how to do it.
tmux
orscreen
are your best bets. alternately,disown
orreptyr
or other tricks might be used. see https://serverfault.com/questions/24425/can-i-nohup-screen-an-already-started-process or https://unix.stackexchange.com/questions/4034/how-can-i-disown-a-running-process-and-associate-it-to-a-new-screen-shell or a myriad of similar questions. the only difference here is running the initial process as a different user; personally i'd usesu
withtmux
. – quixotic Jan 31 '18 at 15:34