Simple SSH Client or data recovering tool.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
_Yank
Prole
Posts: 8
Joined: Thu Feb 20, 2014 8:34 pm

Simple SSH Client or data recovering tool.

Post by _Yank »

Greetings, im Yank. Im a young scripter who likes to code in Lua.
Im here to ask for help using luasocket and love. I dont know if Lua Socket is the best lib I could use to do what I want but it seems very obvious. Well, lets start.

I want to do a simple program which establishes a connection with a linux SSH server. Yea, I want a simple SSH client, but I will not use it for commercial purposes or similiar. It happens that my trashy linux VPS messed up, I cant connect to it using Putty and any others SSH clients.

My VPS provider has a simple VPS managing website where I can make a temporary Virtual Console to my VPS (Like the windows recovery mode), they give me an IP an username and a password to me connect using Putty.

When I connect to the VPS Virtual Console it works well but it returns me a message saying "bash: mesg: command not found" and "bash: groups: command not found". Then when I type anything, it returns me "command not found". Even with sudo and apt-get commands, actually only cd, cat, ls and similiar linux commands works.

My provider said that i should reinstall the OS using "rebuild" option at the VPS managing website. The problem is that I need my files first...

Returning to the topic, I want to make a simple program which will get the text inside every files of the "/home" folder of the VPS and paste it to somewhere on my PC only using the "ls" and "cat" commands. It dont needs to have a GUI or similiar, I will not use the window module, actually I just console output where I can read which files is being read and that.

Anyway, thanks for reading.
Last edited by _Yank on Sat Feb 22, 2014 11:38 am, edited 1 time in total.
User avatar
Doctory
Party member
Posts: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: Simple SSH Client or data recovering tool.

Post by Doctory »

I think this is far off LOVE's capabilities.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Simple SSH Client or data recovering tool.

Post by kikito »

There are several problems.

First, if you can't connect via a regular ssh client, then you can't create a ssh client that will connect. The one you created would try to do the same thing that the regular ssh clients are already trying to do - and that doesn't work.

Second, if you can connect to the server via that "Virtual access", and you can't execute anything, then connecting with a different ssh client (even a custom-made one) will not fix that - you will still get "command not found".

Your best bet is having your provider help you (by copying the files to a different instance, for example). If they can't , then your only option is to go through every single file that you want to save, cat it on the virtual console, copy it from the browser window and paste it somewhere else.
Last edited by kikito on Fri Feb 21, 2014 3:33 pm, edited 1 time in total.
When I write def I mean function.
User avatar
nfey
Citizen
Posts: 63
Joined: Tue Feb 18, 2014 9:50 am
Location: Romania

Re: Simple SSH Client or data recovering tool.

Post by nfey »

I haven't worked with VPS' before, so I'm just going to take some shots at this, maybe something sticks:
Can't you achieve this through the VPS management interface? Is there not some solution of copying the contents of your file system?
If you can't connect through SSH clients, it might mean that the SSH server process is down on your machine. Can you try to investigate why this is? Restart it, somehow?
What protocol does this VPS "temporary virtual console" use? What you are asking from the script is not complex (it's just a recursive file system crawl), but it's not clear to me how you can actually connect from your client to the VPS machine to be able to run the CD and CAT commands.
_Yank
Prole
Posts: 8
Joined: Thu Feb 20, 2014 8:34 pm

Re: Simple SSH Client or data recovering tool.

Post by _Yank »

kikito wrote: If they can't , then your only option is to go through every single file that you want to save, cat it on the virtual console, copy it from the browser window and paste it somewhere else.
Unfortunately it would be impossible, I have like 8000 files there... So I wanted to do that using luasocket and love.
Also, the Virtual Console thingy isnt on the browser, they give me a password, an username and an IP to me connect using Putty or any other SSH client.
kikito wrote:Your best bet is having your provider help you (by copying the files to a different instance, for example).
I will try to talk with the provider saying that.
nfey wrote: I haven't worked with VPS' before, so I'm just going to take some shots at this, maybe something sticks:
Can't you achieve this through the VPS management interface? Is there not some solution of copying the contents of your file system?
If you can't connect through SSH clients, it might mean that the SSH server process is down on your machine. Can you try to investigate why this is? Restart it, somehow?
What protocol does this VPS "temporary virtual console" use? What you are asking from the script is not complex (it's just a recursive file system crawl), but it's not clear to me how you can actually connect from your client to the VPS machine to be able to run the CD and CAT commands.
No, I cant do this using the Provider VPS managing interface. I tried to figure out the problem, it looks like something deleted most of my my sbin and bin directories contents. Well, I can still connect to the VPS using the "Virtual Console" way but like I said only linux commands works like cd, cat, ls, etc.
_Yank
Prole
Posts: 8
Joined: Thu Feb 20, 2014 8:34 pm

Re: Simple SSH Client or data recovering tool.

Post by _Yank »

So, I just need to know how I can make a SSH client.

Actually I found this : https://svn.nmap.org/nmap/nselib/ssh2.lua
How could I use it ?
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 54 guests