Post xml request over telnet on aix - linux

I am trying to post xml request using telnet on AIX machine. I am using following command
cat filename | telnet hostip hostport
Request is going to server and response is also coming back to machine but telnet is not receiving that response.
Same command is working fine with HP-UX machine and telnet is receiving response.
As soon as I hit enter I see connection closed message on AIX machine. while on HP-UX I can see response.
Thanks for any help

Related

How to connect to remote server using linux ssh tunel command

I have an easy-one here, I'm new using linux to connect to other linux server, the issue is that on a remote server which I can reach from my vpn, I have a GUI running on the port x.x.x.x:6500
I did not have any problem using putty/xshell to make a tunnel to the server and then to see the GUI in my laptop using the localhost:6500.
I'm trying to do the same on my Manjaro VM but I'm having troubles to see the GUI since there. The page says connection refused...
I'm using the following command:
$ ssh -L 6500:127.0.0.1:6500 x.x.x.x -v
Maybe the command is wrong, that's not the correct syntax?

Linux command to send data to a remote tcp-client

I have a Linux Server running Redhat Rhel 7 and a Device called "Compoint Lan System (Colas)" (german manufacturer). The Colas has its own firmware so I don't know if it's based on linux. The Colas is set as a TCP-Client. It receives messages from its serial 1 port. I get the messages coming from the serial port 1 of the colas on my server with rsyslog.
Now what I want is to send a string (2 letters) from my server (tcp-server) to my colas's serial port 1 (tcp-client) to get information of the device attached to serial port 1.
Is there a command in linux to accomplish that? Something like "command 'string message' destination port"? I am sorry if it isn't written well.
Install netcat
yum install nc
Make it to listen to a particular port number
nc –l portnumber &
Lets validate it using netstat from a different console:
netstat -anlp |grep yourportnumber
PS: Change the installation command based on your linux flavor.
Ranadip Dutta's answer meets your requirement. The listen there doesn't mean listen for incoming data, it rather means listen for connection request from client. Of course you can't use rsyslog and nc as the server at the same time, but with nc you get the messages coming from the Colas displayed as well as the characters you enter sent.

"curl" connection to ftp impossible : "500 ?"

I am trying to connect to my NAS FTP server from a raspberry pi using the command "curl". The connection use ssl encryption, so I am using the following command type:
curl --ftp-ssl <FTPSERVEUR>:21 --user "<USER>:<PASS>"
Unfortunately, I get :
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 10 allowed.
220-Local time is now 20:38. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 10 minutes of inactivity.
530 You aren't logged in
500 ?
500 ?
500 ?
500 ?
500 ?
And then nothing appends.
It seems that curl is even not able to transmit my ID to the server.. Do you have any idea of what is going on ?
Thank you in advance for your help.
You need to use the URL syntax, i.e. ftp://host.... Otherwise curl does not know which protocol to use and will assume the default, i.e http://.... What you see in the output is actually the result of sending a HTTP request to the FTP server on port 21: First you get the response of the FTP server to the TCP connect (welcome message) which is then followed by several error messages as the result of trying to interpret the lines in the HTTP request as FTP commands.

connecting jconsole to linux box connection failed

I am new to linux and just deployed a java program to run on a linux server. I tried to connect from my windows machine to the linux box with jconsole and got an error.
Connection Failed: non-JRMP server at remote endpoint
I searched online and found the following suggestion was to run the following:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=
[YOUR PORT] -Dcom.sun.management.jmxremote.ssl=
false -Dcom.sun.management.jmxremote.authenticate=false -jar [YOUR JAR NAME]
I entered the following into a batch file and executed it. I then tried to connect using jconsole using the follow command
service:jmx:rmi:///jndi/rmi://ipaddress:port/jmxrmi
as suggested but still cannot (Connection failed: retry)/
I got the same issue but the reason was different, I was hitting http port instead of JMX port.
The error message appeared same as in your case but later I figured out it was port issue.
Since JMX process runs on different port so be careful while opening JConsole on remote server.
Resolved situation by setting hostname to ipaddress when calling process on linux
I faced this problem at localhost.
Wrong port was used.
So, I changed my JMX port to be different from application port in my run configuration and yet, the port changes did not take effect until the application container was restarted.
Fixing above resolved my issue.
Another possible reason for error message Connection failed: non-JRMPserver at remote endpoint: the RootCA-certificate of the server hasn't been added into the client's cacerts file.

ssh tunnel for sendmail

I'm going nuts here, trying to get my system configured.
I have a laptop at home and a workstation at work. I use mutt and sendmail. I have a home ISP that is on a lot of blacklists, so that any email I send from my laptop through my ISP is frequently blocked as spam by the receiver. I can SSH to my workstation and use mutt there interactively, but it is slow and tedious. I download my email from the work server to the laptop with fetchmail.
I've tried to get the laptop to send mail through the work mailer using
ssh -L 25:workstation.work.com:25 workstation.work.com
but it seems that sendmail cannot be running when I do this. When I try to fetchmail from workstation to the laptop sendmail must be running on the laptop for the mail to be delivered locally at the laptop. When mail does go through it gets rejected because the hostname is not recognised. I've tried changing the hostname in mutt. This appears not to affect anything.
So I'm confused about how to configure mutt, sendmail and SSH on my laptop, so that I can compose and send emails from my laptop such that they get delivered, yet I also want to get my emails from the server with fetchmail and have it delivered locally.
Any help appreciated.
If you run that ssh tunnel, you can't be running sendmail locally because otherwise it will be listening on port 25, not your tunnel. And fetchmail by default wants a local mail server to deliver to, although you could configure it to deliver to an mbox file directly if you prefer.
What I do instead is I run postfix on my laptop, and have it set up to deliver mail to localhost:2526 using relayhost=[127.0.0.1]:2526 in /etc/postfix/main.cf. Then I run the ssh tunnel ssh -N -L 2526:localhost:25 ptomblin#myserver so that when postfix goes to deliver, it tunnels out through the tunnel. And local mail clients like mutt and fetchmail see a local mail server running on port 25 like they expect.
Paul: your answer did the business! I was confused and should have been specifying -L 54321:localhost:25 instead of -L 54321:remotehost:25. Note the typo in your relayhost stanza. The square bracket should be closed before the colon, thus: relayhost=[127.0.0.1]:54321.
Thanks for the tip on postfix. I have always used sendmail previously, somewhat blindly, and now on your suggestion have installed and used postfix and find the configuration an absolute delight in comparison to sendmail!

Resources