Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My objective is to have a machine running red hat 7.2, and be able to use VNC to control it. The situation is that im not going to have physical access to this machine, hence my desire to use VNC.
Where I get fuzzy, is how to have the machine boot, and have the X come on and VNC start without someone physically being at the machine. Should I accomplish this via ssh? Or are there other options/better ways to go, etc.
It depends. When you put runlevel 5 and vnc into your startup scripts, they'll boot by default. SSH can help if there's X problem. But in case of serious error (when the system doesn't boot) phisical access is a must.
Actually, you should have SSH startup, but maybe not VNC. You're really best off blocking access to the VNC port at your firewall and only allowing SSH through.
SSh to your box with a tunnel setup for 5901 (for first screen of VNC, or 5902 for second, etc). Note that putty.exe does this quite well if you're working from a Windblows machine as I have to from work.
Launch your "vncserver" program and specify the password.
When VNCviewer is launched at the client side, you have it point to localhost:1 -- SSH kicks in at this point and tunnels your data to your server.
Setting things up this way adds an extra level of security to using VNC over a public network.
I would have to agree with Burke! (Although I will admit I have never done it this way. I may have to go home and play tonight.) For the record though, you can add programs and scripts that you want executed to the...
/etc/rc.d/rc.local
file. Lines in here get executed after the initial boot up but before the user logs in. For my server (in a closet, not off site) I ssh into it and start my vnc server when I need to do maintenance. I don't leave the server up. The best/easiest way to do this will depend on what type of security you need.
Burke, thank you but that sounds complex and im slow
Phil, if i want to do what you're saying, i believe i have to have X running before I can login via VNC. If so, would i start X through SSH, then start vnc?
At the moment i dont have anything, I'm finishing building the machine when I get off work this evening, and then I'm going to start installing all of this.
It is not necessary to have the machine boot into a gui. As long as you have X installed and a couple desktop managers (KDE/Gnome/whatever), you should be okay. Just have the machine boot up to a login prompt (Saves resources!).
As long as you have your vncserver running through some init scripts and it has a password setup, you'll be able to connect to the desktop just fine from vncviewer on Linux or Windows.
Good point mhearn --
thevariegator -- what OS is the machine that you will be accessing this one with?
If you're using a Linux workstation, you can just SSH to the workstation you need to control, then you can launch X programs from the SSH session. Since both machines have all the necessary X stuff, the program will launch the graphical interface on your local station -- it's pretty cool.
putty.exe -- do a search on google. It's a standalone executable - no install required and small enough to fit on a floppy. You can setup tunneling for multiple ports -- great stuff
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.