LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Starting VNC upon boot-up using specific user (https://www.linuxquestions.org/questions/linux-newbie-8/starting-vnc-upon-boot-up-using-specific-user-840814/)

ortizmj 10-27-2010 02:27 PM

Starting VNC upon boot-up using specific user
 
So right now VNC is starting a session using :1. When I connect to that session, the terminal is logged in as root. I'd like for the terminal to be logged in as a different user as some of my end users are going to be using this and don't require such privileges. I found that I can "su" to a different user and start a new VNC daemon on :2 and when I connect to that session, the terminal is logged in as that user. What I want to do is get that to run at boot-up.

Any help in this matter is greatly appreciated!

acid_kewpie 10-27-2010 02:36 PM

Well firstly VNC is awful. I'd personally suggest avoiding it like the plague. Try nx instead, at nomachine.org, it's great.

as for what you're actually asking, you're already doing it if you're su-ing... just add that command to /etc/rc.local

ortizmj 10-29-2010 11:01 AM

I've heard of NX before, but have yet to check it out. I will though... As for this problem though, I'm on a deadline and would like to just get VNC working haha.

I'm not quite sure I follow what you're saying though. What command should I add to /etc/rc.local? I've tried:
Code:

su user; vncserver :2
I've testing the command and it'll su to the user account, but until I type "exit," it won't run the vncserver command - and even then it starts that display using the root account again.

pwc101 10-29-2010 11:20 AM

Code:

su - $USER -c "vncserver :2"

ortizmj 10-29-2010 11:30 AM

Thanks pwc101! Not that you don't know, but in case anybody else comes across this thread and needs help...that worked like a charm! :)


All times are GMT -5. The time now is 02:21 AM.