Far Manager NetBox SFTP can't connect to the linux server - linux

I'm trying to connect to the RedHat Linux server through Far Manager 3.0.5800.0 x64 and NetBox plugin with SFTP. But it doesn't open the session as I expect it and doesn't exposure any errors. The connection screen blinks once and disappears, get me back to the NetBox: Stored sessions panel.
I CAN connect to that server through putty ssh, and it seems to be completely ok.
I CAN connect through Far Manager to THAT server as a different user also as a root user.

The problem was that I recently wrote in the .bashrc file some strings with "echo" command. And it seems to be after that the NetBox doesn't want to establish a session by that user.
So just inspect your .bashrc file and clean all echo commands.

Related

Running GUI without need of remote desktop connection on-going

Build: Server with Ubuntu 18.04 in data center with Ubuntu Mate Desktop interface.
As I understand, any GUI app needs a display in which to function. I connect to the server via x2go to display the ubuntu mate interface.
Once connected, I have a scheduled cron job that launches a terminal, a GUI and some commands.
Everything works perfect as I have previously detected what display I'm using as a user and specify that to launch the terminal and the commands.
Problem: if I'm not connected via x2go client to the server and provide that display, I noticed today that the cron job didn't launch at the specific time (08:50), which was previous to my x2go client connection (09:23); it just launched when I did the x2go client connection from my desktop manually -- my understanding is that it didn't launch because there was not any available display.
I'm not technical enough to get more deep into this problem.
¿Is there anyway in which I can make the cron script function (i.e. that it launchs the terminal and the GUI) without the need of manually getting into my desktop and launching the remote desktop client (x2go)?
My ideas go for having another minimal setup in that data center or another that takes the advantages of being there and have a physical monitor to display constantly connected to the main server OR just manually entering the server via x2go every day.
EDIT: When I disconnect the x2go client session from the server, the launched GUI and etc perfectly maintains, without dissapearing because "I have terminated the session and eliminated the display".
Finally got it working with the great help of one of x2go founders (Oleksandr Shneyder) after understanding how x2go handles the sessions and the X server.
Sessions can suspended/hibernated, disconnected and terminated.
Suspended/hibernated: when "manually" or automatically the x2go server side suspends so that it saves resources.
Disconnected: when you exit the session window and the x2go client in your desktop/laptop.
Terminated: when you log out from the DE environment or issue the x2goterminate-session command in the terminal inside the session.
My x2go app was somehow entering into suspending mode in the server, causing that the display (50 in my case) in which the scheduled cronjob need to be run and launche the GUIs, "was not awaken" until I entered into the session via the
app. In that moment, the cronjob started executing.
To tell x2go server to not hibernate, I needed to change the X2GO_NXOPTIONS in /etc/x2go/x2goagent.options to X2GO_NXOPTIONS="sleep=0"
After this, everything functions perfectly in the server.
Hope it helps others.

Autoit script on remote machine

Currently I am running a jarfile from my CENTOS machine that takes parameters to make a connection to azure Windows VM using WINRM.
I get the sessionID of RDP and using psexec I execute my autoit script on the RDP sessionID (this assumes that I need to have already a RDP connection established).
psexec.exe -i 2 "C:\Program Files\AutoIt3\AutoIt3.exe" "C:\Users\admin\runNotepad.au3"
The script runs perfectly when I have a RDP session maximized/opened. If I minimize the RDP window some commands do not work, as for example the Send command.
How can I guarantee, taking my setup, that a session with GUI is opened and how can I bypass(if there is a way) the constraint of having the RDP window maximized in order to run the test?
I can also change my architecture if required (apart from the CENTOS machine).
Thanks

Remote SSH/SFTP with Netbeans

I know you can set up remote connection in Netbeans or as others have suggested, mount the remote file system locally and let Netbeans read that.
This current set-up I have to SSH into a remote server and then SSH again into another one.
Is it possible in Netbeans to access the filesystem on the 2nd server hop?
I think you can setup a SSH local port forwarding on your first remote server to archive what you want here. Once ssh connection established with the first server, it will be tunnel to second server. Also, will be much more convenient if using SSH public key as authentication method.
Run below command on your local (Need to keep this running)
ssh -NL 2222:server2.example.com:22 server1.example.com
Test connection with ssh locally
ssh localhost 2222
So in your case, Netbeans just need to connect to localhost port 2222.
Ref: https://www.ssh.com/ssh/tunneling/example
That isn't answer you expect, but to big to put it in comment.
I think best solution is configure autostart some service which will create tunnel to first server on your login and bind local port (let's say 2222) to second remote server ssh port. This is basical feature of ssh client. When you can configure Netbeans to connect to localhost:2222 and login right into second server. You might need to use keys authentication for first server.
Where are examples to make such thing. Like is underneath link on article
http://www.pc-freak.net/blog/start-ssh-tunnel-pc-boots-windows-alwaysup/
Since you can get ssh access via a daisy-chain, you can very likely use SSHFS:
https://github.com/libfuse/sshfs
Available in Debian (and therefore, likely many other distributions):
https://packages.debian.org/jessie/sshfs
As long as you have ssh keys set up properly on each server, you can daisy-chain mounting via SSHFS to the machine where your NetBeans app is running.
https://en.wikipedia.org/wiki/SSHFS
NOTE: There are some caveats, including that SSHFS expects that it is the only mechanism used to update the filesystem, and that there is only one writer at a time. Undesirable behavior can occur if you allow other mechanisms to change the files or directories on the target server, including data loss and/or corruption.

"421 Active data channel timed out." with FTP client connection from Azure VM from SQL stored procedure

We're migrating from a Windows server box to Virtual Machines on Azure. Our SQL stored procedure uses Integration Services packages to generate feed files and upload them to client ftp servers.
We do this by building script files and using the native ftp.exe client on Windows. My script file looks like this:
open ftp.ourserver.net
myusername
mypassword123
lcd G:\
cd /
prompt
put "G:\DataFeeds\SmithCo_02272017.txt" "SmithCo_DailyFeed.txt"
bye
This works fine on our old server. When I use command prompt to run this code I'm getting:
421 Active data channel timed out.
I can upload the file manually with just a basic connection using WinSCP client on that machine.
I thought it was a port issue so I created an outbound rule in Windows Firewall for port 21, allowed all connection.
Then I created an endpoint in Azure for port 21 as well.
Is there another step to open this up or something I may be missing?
The Windows command-line ftp.exe supports the FTP active mode only. In the active mode, the server has to connect back to the client to establish data connection for a file transfer. More over the ftp.exe does not allow you to pick, what port is used for the data connection. It randomly picks any available port number above 1024. So you would have to create end points for all ports above 1024. That's possibly something you do not want to do. Though you can try.
WinSCP works, because it (as most modern FTP clients) uses the passive mode by default. For the passive mode, you do not need to open any ports on the client side.
Read my article about network configuration for FTP active and passive connection modes for details.
As WinSCP works for you, you can use WinSCP scripting interface to replace your ftp.exe script.
It would be like (ftp.txt):
open ftp://myusername:mypassword123#ftp.ourserver.net/
lcd G:\
cd /
put "G:\DataFeeds\SmithCo_02272017.txt" "SmithCo_DailyFeed.txt"
exit
(Though the lcd is redundant, both in your and WinSCP script).
And run the script like:
winscp.com /script=ftp.txt
See the guide to converting Windows FTP script to WinSCP script.
(I'm the author of WinSCP)

How Can I connect to Amazon Linux instance using Remote Desktop from Windows 7?

I created an EC2 Amazon Linux instance (yes, an amazon version of linux..)
it is launched but I can't connect using Remote Desktop...
am I trying to do something crazy here?
I got a message that Remote Computer is not available on the network
If you mean Windows RDP (Remote Desktop) that is your problem. Most likely you will need to use an SSH client to connect. I suggest Putty.
You should've received an SSH key when you setup your server. You will need to convert that key using PuttyGEN (same page as the Putty download) to convert it then use it with Putty to access the server.
Trying to walk you through the process of installing a GUI and VNC on the server is a bit much for here but give this video a shot. It seems pretty thorough and from skipping through it I saw no obvious errors in his process.
Try installing the vnc4server package. Then you can use a client such as TightVNC to connect from a Windows machine. You'll also need to open up port number 5900 in your firewall, which is the default for VNC.
You'll also have to have a desktop environment installed on your EC2 instance - by default you may only have the server packages which will not give you a GUI.
For your information, some folks posted remote desktop conf for EC2 instances.
http://activeintelligence.org/blog/archive/remote-graphical-linux-desktop-on-ec2/

Resources