Invalid magic cookie when connecting in mac - macos

I am trying to access a remote ubuntu server through ssh -X from mac. I enabled X11 Forwarding in the sshd_config. After connecting the ubuntu, when I try to start wireshark, I get the below error
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: localhost:10.0
thanks

Do an 'xhost +' on the host Mac (look up the man page for xhost if you want it more secure than allowing all X11 hosts to connect), then ssh -X.

I had the same problem when I used NoMachine client to connect to the remote host. I fixed by terminating the current NoMachine session and starting a new one.

Related

Failed to connect to Mir: Failed to connect to server socket: No such file or directory Unable to init server:

I have installed ubuntu terminal in window 10. It's work fine but when I install gedit or any other application then these applications installed successfully but I can not open it. Whenever I tried it gives me the Error mentioned below.
"Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
(gedit:4821): Gtk-WARNING **: cannot open display:"
In the description of "Ubuntu terminal", it says: "run Ubuntu command line utilities". gedit is not a command line utility. It is a graphical utility, so it is not supported out of the box.
Your hope is that the final error is cannot open display. I bet that if you provide a suitable display in your computer, the utility will show up. Search for a X-server for your windows machine and try with the X-server installed.
This could help: https://www.howtogeek.com/261575/how-to-run-graphical-linux-desktop-applications-from-windows-10s-bash-shell/

Run GUI program on Docker via SSH

so I have Ubuntu headless server on which I have docker installed.
I would like to run GUI app in Docker container and see them on my mac when I connect via ssh.
I followed instructions from here
What i did:
1) install xQuartz on mac
got the auth list cookie:
Cyrils-MacBook-Pro.local/unix:0 MIT-MAGIC-COOKIE-1 02f42525dec4a8b4ee2xxxxxx
2) connect to my remote server via ssh - X uname#password
3) installed xauth on the server
got the xauth cookie:
ubuntu/unix:10 MIT-MAGIC-COOKIE-1 0e6810e9913aca02e0xxxxxxx
4) add the xauth cookies to the container: the one from the server and the one from my mac
5) Launch a docker container and installed firefox to test
6) install xauth in the container
7) add the xauth cookies to the container: the one from the server and the one from my mac
8) but when i run firefox (inside the container), i got this error:
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Broadway display type not supported: localhost:10.0
Error: cannot open display: localhost:10.0
When i do echo $DISPLAY in the container, i have:
localhost:10.0
When i do echo $DISPLAY in the server, i have:
localhost:10.0
When i do echo $DISPLAY on my mac, i have:
/private/tmp/com.apple.launchd.G35gSHS5qU/org.macosforge.xquartz:0
I've enable the X11forwarding on my Mac (ssh_config) and my Server (sshd_config) and when i enter my container and launch the GUI app, I got this error:
X11 connection rejected because of wrong authentication.
The error is obvious, but I don't know how to fix it.
In the container, the cmd xauth list give me:
Cyrils-MacBook-Pro.local/unix:0 MIT-MAGIC-COOKIE-1 02f42525dec4a8b4ee2xxxxxx
ubuntu/unix:10 MIT-MAGIC-COOKIE-1 0e6810e9913aca02e0xxxxxxx
in the server, the cmd xauth list give me:
Cyrils-MacBook-Pro.local/unix:0 MIT-MAGIC-COOKIE-1 02f42525dec4a8b4ee2xxxxxx
ubuntu/unix:10 MIT-MAGIC-COOKIE-1 0e6810e9913aca02e0xxxxxxx
in my mac, the cmd xauth give me:
Cyrils-MacBook-Pro.local/unix:0 MIT-MAGIC-COOKIE-1 02f42525dec4a8b4ee2xxxxxx

Can't connect remotely to WAS 8.5 full profile installed on Ubuntu 14.04 from RAD 9.5 installed on OSX

WAS 8.5 full profile isn't officially supported on OSX by IBM so the only option to perform development from OSX is to install stub runtime and connect to WAS installed remotely. I'm trying to install such scenario but something done wrong and can't connect to my WAS.
There's my installation:
On OSX El Capitan Installed:
RAD 9.5 with WAS 8.5 stub runtime (WebSphere Application Server traditional V8.5 stub)
Installed Virtual Box with Ubuntu Desktop edition 14.04
Ubuntu's hostname: anatoly-ubuntu-vm and it's accessible from host, i.e. ping anatoly-ubuntu-vm works fine
On Ubuntu installed:
WAS 8.5 full profile at /opt/IBM/WebSphere
Created AppSrv01 profile at /opt/IBM/WebSphere/AppServer/profiles
WAS installed with root user, IBM Installation Manager required root permission when was started
My connection settings in RAD:
server name: WebSphere Application Server traditional V8.5 stub at anatoly-ubuntu-vm
hostname: anatoly-ubuntu-vm
Runtime environment: WebSphere Application Server traditional V8.5 stub
Connection type:
I've tried RMI 2809 and SOAP 8880 both options didn't work
Enable the server to start remotely is checked and Select the operating system running the remote server: checked Linux option with my username and password. I've tried my regular Ubuntu account and root, both option didn't work.
Server profile path defined as /opt/IBM/WebSphere/AppServer/profiles/AppSrv01
When I try to start server I get the following exception:
The following problems has occurred when starting the server.
CTGRI0001E The application could not establish a connection to
anatoly-ubuntu-vm .
What am I doing wrong?
UPDATE 1:
After I've written this post I've figured out that SSH server isn't installed and configured at all as described here: Requirements for using Remote Execution and Access (RXA) Now, I've installed and it seems like connecting but stuck at 23% at stage Preparing launch delegate, after a while it throw the following error:
The following problems has occurred when starting the server. The
server may not be started in the correct mode. You can restart the
server to desired mode if it is started. CTGRI0075E A file transfer to
or from the system named [anatoly-ubuntu-vm] timed out before the
transfer could complete. The current timeout interval is set to 240000
milliseconds, and might need to be increased.
UPDATE 2:
As I can see despite error message server is started and I even can connect to web console anatoly-ubuntu-vm:9060/console/ibm but it looks that not SOAP connection, neither RMI connection don't work. When I run Test Connection from Settings overview page in RAD, I get the following error:
The connection failed after trying to use all the available connection
types.
Verify the port values are correct and the server has been started. If
the security of the server is enabled, verify the "Security is enabled
on this server" check box is selected, and the user ID and password
are provided. You can specify this in the server editor or when
creating a new server.
For a Technote with details on the most common server connection
problem, see http://www.ibm.com/support/docview.wss?uid=swg21266028.
The last connection attempt failed with the following exception:
ADMC0016E: The system cannot create a SOAP connector to connect to
host anatoly-ubuntu-vm at port 8880.
UPDATE 3
As #DanielBarbarian guessed I tried to run ./wsadmin.sh -port 8880 and it worked and returned
Connected to process "server1" on node anatoly-ubuntu-vmNode01 using SOAP connector; The type of process is: UnManagedProcess`
This is settings of my ports:
UPDATE 4
When I trying to run telnet anatoly-ubuntu-vm 8880 from OSX host I get the following response (ip address changed to non real due to privacy issue):
anatoly-mac:~ anatoly$ telnet anatoly-ubuntu-vm 8880
Trying 192.168.10.10...
Connected to anatoly-ubuntu-vm
Escape character is '^]'.
HTTP/1.1 408 Request Timeout
Content-Type: text/html
Content-Length: 117
Connection: close
<HTML><TITLE>408 - Request Timeout</TITLE><BODY>
<h1>408 Connection timed out while reading request</h1></BODY>
</HTML>Connection closed by foreign host

Git and http_proxy (SparkleShare on windows and http_proxy)

I've just successfully built SparkleShare for windows according to guide:
https://github.com/wimh/SparkleShare/wiki
and exported my ssh public key to a server.
The problem is that I can't connect from a client behind a http_proxy to a public server with ssh running on a custom port. I had also problem with cloning any git server. I need to switch git:// protocol to http:// one. Any suggestion? Does anyone have similar experience?
This is a log file:
15:25:13 [SSH] ssh-agent started, PID=4380 Identity added:
C:\Users\MYUSER\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key
(C:\Users\sg0922706\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key)
15:25:34 [Fetcher][C:\Users\MYUSER\Documents\SparkleShare.tmp\share]
Fetchin g folder: ssh://MYGITUSER#MYHOST/MYPATH 15:25:34 [Fetcher]
Disabled host key checking MYHOST 15:25:34 [Cmd] git clone --progress
"ssh://MYGITUSER#MYHOST/MYPATH" "C:\Us
ers\MYUSER\Documents\SparkleShare.tmp\share" 15:25:37 [Git] Exit code
128 15:25:37 [Fetcher] Failed 15:25:37 [Fetcher] Enabled host key
checking for MYHOST
To get SparkleShare to use your proxy you will need to modify the config of the msysgit that is installed as part of SparkleShare. Navigate to C:\Program Files (x86)\SparkleShare\msysgit\etc and edit the gitconfig file in notepad and add the following line under the [http] tag
proxy = http://user:pass#proxyurl:port
modifying the url as required to match your settings. You can then use the "On my own server" option to add the http url of your repository.
I have a work around on this particular problem. I guess that you already successfully connected to your server via a simple SSH client (i.e. PuTTY)? With PuTTY you can easily configure an ssh connection via any kind of proxy (such as HTTP, SOCKS, Telnet, ..)
What you can do now is to specify a local "tunnel" (an SSH port forwarding rule) like this: L22 127.0.01:22 (see attachment). If you are using a ssh command line add the following option: -L 22:127.0.01:22.
So now as soon as your terminal is open and running you'll be able to reach your git server via the server url: ssh://git#127.0.0.1.
If your local port 22 is busy you can define the tunnet on a other port. i.e. if the 44 is not occupied: L44 127.0.0.1:22. The url to use in SparkleShare become ssh://git#127.0.0.1:44.
But it's a work around. I'm looking for a better solution.

How to connect to server via ssh but use native "Connect to Server" in OS X?

I have a remote server I manage via command line on Snow Leopard. I ssh into it, etc. All of my ssh keys are setup, and I have configured a local alias that lets me login with one command. What I'd also like to do is be able to connect to it via ssh, but have it mounted locally as a remote drive.
I've tried the Connect to Server, command-k, but when I try the address as "ssh://myusername#the.IP.address" I get a warning from OS X:
URLs should begin with afp://, cifs://, ftp://, ftps://, http://, https://, nfs://, smb:// or vnc://
So how, if possible, can I mount my remote server as a drive and have it using the existing secured ssh keys I have already configured?
You want sshfs from the MacFUSE project.

Resources