Using tkdiff on windows with putty session - putty

When I try to execute tkdiff inside my putty session. I get this message "Application initialization failed: no display name and no $DISPLAY environment variable" and it hangs. Please suggest how to configure tkdiff.

This is not a tkdiff problem. It means you don't have an X server (graphical window manager) running that putty knows about.
You have to at the very least go into putty's Connection / SSH / X11, and "Enable X11 forwarding". However, you also have to have an X11 server running on your system, which is more complicated.

Related

Firefox in AWS instance

I tried to install firefox on my redhat 8 machine.but I get
" running firefox as root in a regular user's session is not supported. ($xauthority is /run/user/1001/gdm/xauthority which is owned by user.) "
Then I try it as normal user then it shows another error.
" Failed to open connection to "session" message bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Running without a11y support! "
How to install firefox in Rhel8 (AWS EC2)? Is this possible?
I assume you are connecting via ssh (text mode). Firefox needs a graphical environment to run, which is not available in EC2. You will need a text-only browser.
It seems to me that you need something like WorkSpaces, not ec2 with ssh.
https://docs.aws.amazon.com/workspaces/index.html
The minimum you also need to install with firefox would be the xauth package. This should let you run firefox both as a normal user and while su to root. As root you will need set the XAUTHORITY env variable to point to your .Xauthority file, e.g.
# export XAUTHORITY=/home/sbaby/.Xauthority
This assumes, of course, that you ssh to your server with a X11 server listening for connections. Refer to your ssh client for documentation on how to set that up.

Is it possible to restart the server using WinSCP?

I transferred the files from my local computer to the remote directory using WinSCP, but I'm curious if I can restart/reboot the server using the same application or i need to do that using PuTTY.
I don’t think you can. WinSCP is a SFTP client, SFTP its a subsystem of SSH, but that does not mean that you can achieve everything you can do with SSH.
Here’s a complete list of commands supported by the SFTP protocol -> https://www.ssh.com/ssh/sftp/#sec-SFTP-Protocol
As you can see there’s no such ‘reboot’ instruction nor anything similar.
EDIT
As other answer says, WinSCP has the ability to issue remote commands https://winscp.net/eng/docs/remote_command
So you can do Commands > Open Terminal and issue a reboot
WinSCP has Console window, where you can execute most shell commands. The only limitation is that the command must not require terminal emulation. What command like reboot typically do not.
Short answer: you need putty to do it.
Long answer: If you know what you are doing you could have a watch of some kind and reboot the server if you copy a special file (via WinSCP) to the server, I would strongly advise against this.
If you use putty to do this you should be aware that the system user root is most likely forbidden to log in via ssh directly. So you have to use putty with some other user and use su/sudo to reboot.
To reboot a linux server
putty
sudo reboot

GUI programs won't open in an ssh server. ssh -X and downloading XQuartz have not helped

So I use a remote server for some of my schoolwork and have no trouble logging onto the machine and navigating. The problem arises when I attempt to run a software that uses a GUI called ds9. It's used for image processing but I don't think that is relevant. Anyways, I've tried ssh -X username#university.edu, I've downloaded XQuartz, and I've made sure XQuartz's Security preferences are all checked. Still, I receive the same error message: Application initialization failed: no display name and no $DISPLAY environment variable
Unable to initialize window system.
I would be extremely grateful if anybody could identify the issue.
It may happened that you set a wrong DISPLAY env. var. at login time on the server. In general, ssh -X set the value to something like DISPLAY=localhost:10.0 (a tunnel set up by ssh in between your server and your local machine).

Start Windows GUI program in the PuTTY shell

I created an SSH session into my localhost through PuTTY. I am running OpenBSD server on the localhost which is a Windows 7 machine. The login was successful. Now I want to start programs in the PuTTY shell for example notepad.exe. I changed the directory to c:\windows\system32. The command start notepad runs without error but I don't see any window.
Is the notepad running in the background without a windows. If yes, how to make the window visible??
Yes, it's quite likely the Notepad is run in an invisible Windows session on the server. Note that it does not make a difference in this case that the server is the local machine.
If you hoped for the window to appear on the "local" machine magically, you are out of luck.
Generally, it's possible to run a GUI application on remote machine and see the GUI locally. On Unix it's quite common. Typically X Window is used for that.
But Windows GUI applications cannot be "tunneled" via SSH session to a local machine.

login from cygwin to Mac OS X using xterm issue

open cygwin shell
run ssh -Y user#MACOSXSERVER
No xauth data using fake authentication data for X11 forwarding <-- Warning
login MACOSXSERVER OK
set DISPLAY=CYGWINIP:0.0
xterm &
And I get the following error
Xlib: connection to "CYGWINIP:0.0" refused by server Xlib: No protocol specified
What went wrong?
You're rewriting the value of $DISPLAY as set by sshd. This is preventing X forwarding from working. Stop doing this.
running xhost + before run ssh solves this problem.

Resources