FTP connection issue over Linux Lite LTS


#1

Hi all,

So I’ve re-installed MineOS onto my server that now has Linux Lite LTS on it (as opposed to the Turnkey solution). The server itself is running smoothly and I’m really happy with the setup of the Server and t he Webui.

The problem I’m now having is trying to get the SFTP up and running. I use filezilla normally.

I have installed vsftpd onto the server and did set up a user and a file path, which to be honest was pretty useless because i couldn’t go where I needed to go to manage my minecraft server files. It did eventually work however, which proved to me that vsftpd was up and running.

I’ve added port 22 to open both ways in the Linux Firewall settings as a rule. I did also test the ftp with the firewall turn off. (didn’t help my issue)

I cant remember setting a password for the root user when I installed MineOS or even if it asked me for one. I have only one password I use at that level anyway and I’m confident I would have used that password. I will be setting up and RSA Key tho once I can get logged in via putty.

I researched the Root Login page here:

I found that I needed to use this command to set up the sftp side:
sudo apt install openssh-server fail2ban
This gave me the files that were mentioned in the wiki above.

I set the PermitRootLogin to Yes and restarted the ssh service.

But Filezilla will still not connect.
I tried to do it through a web browser: ftp://ip address:22, Again the user I set up when installing vsftpd worked but not the access to the minecraft files I need to manage the server.

I’ve been looking for the file that holds the user details (if there is one) so I can confirm any passwords? other than that, I’m at a loss here, what id like to do:

  1. confirm that the sftp system (whatever you guys name it) is actually working.
  2. try to find the user details for the Root user set by MineOS,
  3. get filezilla working so I can manage my server files, and finally
  4. install an RSA Key to the root user for a little added security.

As always any help is appreciated.

Please don’t explain away what my problems are. Id actually like to go to the troubleshooting and finding solutions rather than someone regurgitation what or why the fault is. I’m sure that will come to light as we work through this process to resolve these issues.

I do have a discord channel and im on Australian Eastern standard time if youd like to work with me through this in real time: https://discord.gg/CHm9xE

Jeddell


#3

openssh is pretty much found on all Linux systems, and serve both SSH and SCP (the file transfer protocol most like what you’ve used in FTP).

However, you wouldn’t want two services on port 22 for that function (one being openssh-server and the other being vsftpd).

Likewise, understand both are SFTP, which is different than ftp://ip (because FTP is a handle that wouldn’t understand communicating with an SSH/SCP/SFTP server like the ones you’re working with).

So:

  1. confirm you can log in as some non-root user with PuTTY (or whatever terminal client you’re using).
  2. use the exact same credentials in filezilla, and be sure to leave out ftp:// etc.

#4

OK, so I used the “mc” user and pass to connect through putty and it worked fine, I managed to log in. I used the exact same user id and log in in filezilla. I get the following:

|Status:|Connecting to 192.168.1.250...|
|---|---|
|Response:|fzSftp started, protocol_version=8|
|Command:|open "mc@192.168.1.250" 22|
|Command:|Pass: ********|
|Status:|Connected to 192.168.1.250|
|Error:|Connection timed out after 20 seconds of inactivity|
|Error:|Could not connect to server|

I also had a play with the dual ssh thought with vsftpd and sshd. I switch them both off:
service sshd stop and service vsftpd stop . I found when both were off, ftp connection was refused on filezilla. I then turn one on at a time and found that when leaving vsftpd off and sshd on, Filezilla was timing out as the error above and I still could not connect. so at this stage I’ve left vsftpd off.

Finally, I tried to turn openssh on…this version of linux does not have it. Ill look into getting it installed.


#5

The package name I believe is typically named openssh-server and that should handle both ssh and sftp by default, I think/am pretty sure that sshd (sshdaemon?) is associated with openssh-server though so it should be installed, otherwise you can try typing in openssh and then tabbing a few times for autocomplete/suggestions to show up.


#6

typed sudo openssh. tabbed a few times as suggested. gave me
/archive / backup /import profiles/ servers/

none of which tell me what i need to know or how to use


#7

Your current directory happens to be /var/games/minecraft, that’s why, so it is showing you subdirectories of that directory. What you’ll need to do is type in apt-get install openssh and then hit tab, however you’ll also need to add sudo to the beginning afterwards (tabbing doesn’t work when you have sudo already at the beginning so you do it without and then go back and put it after, example apt-get install {name} [tab for autocomplete/suggestions] and then once you get/find what you’re looking for, go back and prefix it with sudo and it’ll work)


#8

but what am I looking for??? going back to nt original requirements.

  1. confirm that the sftp system (whatever you guys name it) is actually working.
  2. try to find the user details for the Root user set by MineOS,
  3. get filezilla working so I can manage my server files, and finally
  4. install an RSA Key to the root user for a little added security.

so…step 1…?


#9

We don’t name it, but it’s package name typically is openssh-server.


There is none, as MineOS is just the web ui and it’s scripts; MineOS itself does not set user account ids or passwords.

Ubuntu (and Ubuntu based distributions) typically do not have a root user password and actually is password disabled, for security purposes/reasons (and no one here really recommends making use of root unless you absolutely have/need to for some reason, such as updating the system); see: https://help.ubuntu.com/community/RootSudo



#10

quoting posts ive already read and responded does not help

My end state is to get filezilla open and working so I can mange my minecraft serve files. so far you’ve just regurgitated what already here. if you have a means of finding a solution I’m all ears.


#11

When you login via PuTTY what exactly does it show, is your default directory (or the contents of your directory the contents of) /var/games/minecraft? Is openssh-server installed?

You typically never want 2 services on the same port on the same IP (or machine) and is pretty much what you’ve done, if you still cannot login using a non root account (aka your mc account, same used with PuTTY) on port 22 for SFTP, stop the other service(s) you’ve installed/added, start/restart sshd and try again.

That’s more of an extra that you don’t really need unless you want it so you can also stop/get rid of that for now as well.

If you are still not able to login then I suggest pretty much purging the programs and configuration files (apt-get purge {programs}) related and then only reinstalling openssh-server and trying again afterwards, and if it works then work from there.

Quoting helps by highlighting and referring to what I’m responding to and/or why I say or give a specific response, which may also help others in the future who come across this thread. There’s no point in just posting something that could/would seemingly appear random for no reason without context to what it’s about or referring to or what it’s for, and it also helps to keep track of and group specific relevant posts together for/as quick reference points of interest; I mean I could also always pretty much go the old purge everything and start over from scratch route rather than the provide hints/suggestions and possible solutions route but that doesn’t help solve/fix the specific issue if/when it happens directly; I don’t think any of us here have ever used anything other than openssh-server for SSH and SFTP, we probably have not ever even batted an eye at any alternatives, so this is new to us.


#12

writing war an peace is just confusing the whole issue: here is what is shown when I putty into the server. I had to open sshd:
https://pastebin.com/D29mE4Fr

when I open the ‘beginner’ gui to install programs, openssh-server has a blue tick against it and it appears to be installed. I have no idea if its on or not (hence question 1).

trying to purge now.


#13

Alright, seems like a fairly “normal” openssh session though can probably be simulated by others/alternatives, however to check whether a service is up and running or not would be via service {service} status (much like how you start and stop them), and with purging since you did have everything else working, based upon everything posted so far I’d say purge openssh* fail2ban vsftpd then install openssh-server again and then things should pretty much just work unless there’s something else relevant not indicated or referenced. If it still doesn’t work afterwards though the best I can do is attempt to replicate the issue in a virtualized environment, though it may not turn out the same but I can try anyway whenever I’m less tired (I apologize if sometimes I may seem a bit harsh at times, it’s not intended, I’m just tired and it doesn’t help when you’re in the scenario that I’m in almost daily in real life). Just for recap though (both for reproduction purposes and/or for finding out what may/might have gone wrong and where and how to potentially undo/fix it), after getting everything up and running, the moment you begun to focus on the ftp/sftp portion of this, what exactly did you do and in what order/steps?


#14

OK,

I purged the following:

apt-get purge vsftpd
apt-get purge fail2ban
apt-get openssh*

tried to putty in: would not connect

installed this:

apt-get install openssh*

Tried to Putty in could connect with non-privileged user
Tried to connected with filezilla. would not connect

tried:

service openssh status

returned error
Unit openssh.service could not be found

tried

service openssh-server status

returned:
unit openssh-server could not be found.

checked the package manager in the OS and openssh is installed. still cant tell if its running other than the putty in


#15
  1. logs exist to help diagnose connection issues. Check in /var/log for what openssh-server is doing.

  2. Don’t * (wildcard) install. Find out what you need and install that. In this case, apt-get install openssh-server is what you want, because it’s different from openssh-client which already exists and there’s no reason to muddy the waters by installing * and uninstalling * when we know the specific package’s name perfectly.

openssh-server is the package name (use for apt-get). sshd is the service name (use for service).

  1. We’re unfortunately stabbing in the dark because even simple things like 'are we sure it is openssh-server currently serving on port 22 is unclear to us. I know you’ve said you’ve purged the rest, but we understand you’re learning, and right now we can’t take it for granted that previous package installs aren’t impacting your success.

So let’s try this. Log onto your server as mc (non-root user).

$ touch newfile
$ scp newfile user@127.0.0.1:/home/user/newerfile
Warning: Permanently added '127.0.0.1' (RSA) to the list of known hosts.
newfile                                                               100%    0     0.0KB/s   00:00    
$ ls new*
newerfile  newfile

What I’ve done here (and you can do as well) is created a simple, empty file. I then used SCP (remember SSH and SCP operate on the same service) to copy it to a new file. Upon seeing both files exist, I know the following things: 1) I have the password working, 2) it matches my putty login password, 3) sshd is accepting connections and working, for both SSH and SCP (SFTP).

So give it a try:

cd
touch newfile
scp newfile mc@127.0.0.1:/home/mc/newerfile
ls new*

Report back.


#16

OK, did the commands (less the $. it doesnt recognize that character as a command)

touch newfile Returned no error

scp newfile user@127.0.0.1:/home/user/newerfile

Returned:

The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:GjS0yitoF2a2zdCsb3QuHR1vE+wQIw2rPuU5SYJHM/g.
Are you sure you want to continue connecting (yes/no)? : 

Typed yes

Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.

user@127.0.0.1's password: Tried using my standard passwords. wont work. tried 3 times then. I honestly don’t remember placing any passwords for this. For my server I’ve only ever used two standard passwords and nether works.

user@127.0.0.1: Permission denied (publickey,password).

ls new*:

returned:

newfile

seems in this instance I have a password issue?


#17

I gave you the output for what I used because my user is called user.

Your login is not user, so you should replace it with your actual user name, as shown farther below:

In the future, it’s easier if you copy everything, top to bottom, rather than pick and choose what you copy and paste it all separately. Also, you’re not meant to type $, but you’ll notice you also have that $ because it means "this is typed as somebody who is not root" (this is a general internet convention).


#18

OK, my bad

    cd
    touch newfile2
    scp newfile2 mc@127.0.0.1:/home/mc/newerfile
    mc@127.0.0.1's password:
    Welcome to Linux Lite 4.2 mc
    ls new*
    newfile  newfile2

Returned no errors. but nether did it add the “newerfile”


#19

It’s still unclear what user you’re logged in as when you run these commands.


#20

I logged into puty as a non privileged user “mc”


#21

Are you SURE you’re actually copy/pasting what is on your screen?

Because it makes no sense to me that upon your scp command that it would display “Welcome to LinuxLite 4.2 mc”. So either the commands are different than what I’m saying… or LinuxLite 4.2 is using a very-foreign-to-me SSH server.

Are you editing the output before you paste it here? Just to be clear…don’t. It would hinder the ability to troubleshoot.

Edit: Thank you for the screenshot, I can see now your distro is behaving outside my expectation and I’m looking into it right now.