1

Ok, I usually don't ask questions, because by lurking around here for a couple hours I can find what I am looking for. This one has me stumped though, and I'm not entirely sure that what I want is possible easily.

I have a setup where I would like to be able to log in locally and also with the same username over ssh + vnc and manipulate the same running programs over either session. Basically I want to act like I just sat down in front of the computer whether I did or not - I leave it logged in almost all the time.

The reason why I do not want to use x0vncserver is because my local display is 1920x1080 and I need to slam it down to 1366x768 or the VNC connection gets slow. I did not find a way to do that with vncserver without running it as a separate display. (I am using tigervncserver by the way)

So far the only option I can think of that I haven't tried yet would be to ALWAYS log in over VNC, and use a different local username. Perhaps I'll give that a go unless someone here can help me with a better answer. Does anyone know a way to do what I want?

1 Answer 1

0

OK, this does not answer my question at all. However, it does fix the problem that I was trying to solve.

I have edited /etc/pamd.d/sshd with the following at the end: session optional pam_exec.so seteuid /home/root/ssh_sessions.sh


ssh_sessions.sh:


!/bin/bash

set -x

if [ ${PAM_TYPE} == "open_session" ]; then xrandr -d :0 -s 1360x768 x0vncserver passwordfile=/home/tyler/.vnc/passwd -NeverShared -display :0 & fi if [ ${PAM_TYPE} == "close_session" ]; then killall x0vncserver xrandr -d :0 -s 1920x1080 fi


What this does is change my local display resolution when ssh connects and runs vnc on the local display. Then when ssh disconnects it changes back to the regular resolution and kills the vnc connection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .