Install an ssh client with XServer emulator
Most of my co-workers of around my age, have grown up with Putty. And apparently we as computer consultants are quite hooked to our tools. I know, only yesterday I mentioned it to a co-worker, that everywhere I come the two first tools I install are:- Firefox (unfortunately to be downloaded using IE or Edge, it's from then on immediately the last time I use those browsers, as far as I'm concerned)
- Total Commander (of course downloaded with Firefox): I really hate Windows Explorer, ever since it is introduced with Windows 95/NT. Windows 3.1 had FileManager (yes I"m that old...)
I liked that much better than the successor Windows Explorer. But little filemanager beat the revival of Norton Commander: Total Commander. I use it almost all of my carreer, and so much that quite early on I bought a key for what we would call 'an apple and an egg'.
But about the the third tool I install is: - MobaXterm:this tool is so much richer than Putty. It includes a SCP/SFTP client that can follow your terminal. Which means, every time you cd to a certain folder, your SFTP window will cd to it as well. I like the fonts, the looks more, it's more comfortable. But it also includes a XServer, with no additional install! It's free, with a limited number of sessions though. However, the cost for a lifetime license is really low.
Quite because of the same reasons I would recommend Total Commander over Win Explorer.
When connecting to a server, MobaXterm, by default (although you can uncheck it) will do X11Forwarding.
However, in the case of my colleague, unfortunately X11-forwarding was disabled:
We installed xclock which additionally installed several X-libraries. We checked XForwarding in /etc/ssh/sshd_config. All with no luck. But, we were so close. In the end, the answer (thanks Radu) was in this whitepaper. We needed to set the X11UseLocalhost property to no in /etc/ssh/sshd_config.
The complete setup, following the whitepaper:
- Log into the instance (obviously)
- Configure SSHD to not use localhost for X11:
- Open /etc/ssh/sshd_config in your favorite editor.
- Search for the line that has X11UseLocalhost (it’scommented out).
- Uncomment the line by removing the # from the beginning.
- Set the property to no.
- While you're at it, check if the property X11Forwarding is set to yes.
- Save the file.
- Restart the ssh daemon by executing: sudo systemctl restart sshd
- Install xauth by executing: sudo yum-y install xauth
- Install xterm (used to verify X configuration) by executing: sudo yum -y install xterm
- Also isntall xclock for simple testing of the X Forwarding: sudo yum -y install xclock
When running xclock on the remote terminal will show a clock on your local desktop.
As can be seen in the screendump, you might run into the message 'Missing charsets in String to FontSet conversion'. This can be solved following this hint by RedHat. It is caused by improper locale environment variable. Run the following:
export LC_ALL=C
You might want to add this to your ~/.bash_profile. Then run xclock again.
But, but, but... I can't log on to oracle...
To make things slightly more complicated, in most situations, you can't logon as the oracle user. You get a user to connect, and then have to sudo to oracle. In those cases you ned to redirect your xauth.So, perform the following:
- Connect as the user provided
- List your xauth by executing: xauth list $DISPLAY (you might need to check the DISPLAY variable)
This would provide a line like:
darlin123/unix:11 MIT-MAGIC-COOKIE-1 1231a6f34cca12394d3233456230df26
- Sudo to oracle: sudo su - oracle
- Then set the DISPLAY using the port from the xauth list above:
export DISPLAY=darlin123:11
(In some examples explaining this X forwarding across users, you might see export DISPLAY=localhost:11. But, remember: we disabled the use of localhost above). - Then add the autorisation with:
xauth add darlin123/unix:11 MIT-MAGIC-COOKIE-1 1231a6f34cca12394d3233456230df26
Also take over the port in the display, as well as the GUID (in green) from the xauth list.
That should work!
No comments :
Post a Comment