Is it possible to use SFTP with Virtualmin??

Not sure why I keep agreeing with fakemoth but I do.

The file manager is a great utility and is great for clients who don’t know how to do thngs SSH for removing things in a fast manner.

The SSH login, do we need it at all?

Howdy,

We are indeed looking into improving the filemanager, that’s something that will happen. We would like it to not be Java-based either :slight_smile:

Regarding Welshman’s SSH question – it may not be necessary at all in some setups. In that case, the SSH login option can be disabled on those servers. We’re not going to disable that by default since some folks do want that, but in cases where it’s not needed, it’s no problem to disable that altogether.

-Eric

There is already a pretty good replacement for the SSH Login, which I thought we’d already made available by default in Virtualmin systems, but I’ll have to check to be sure. Basically, AJAXTerm is a great replacement which only needs JavaScript.

We’re also looking into adding WebSockets support to the Webmin web server, which will make some of this interactive UI stuff nicer. A good editor is high on my list of things I’d like to see, for sure, and there are actually a few good JavaScript editors out there now, though I think they all require node.js on the server-side, which is more weight than we’d be able to include in Webmin, but it might be possible to make a package available for Virtualmin, or maybe just an optional module. Porting the node.js backend to Perl and having it run under the Webmin server would also be an option, but I believe it would be extremely time-consuming and it’s such an infrequently requested thing that I can’t really justify focusing on it to the exclusion of other stuff.

Porting File Manager to JavaScript is a huge job. It will happen, for sure. How long it’ll take, I dunno. None of us are particularly strong on JavaScript. But, having Ilia taking over most of the theme work for the time being frees me up to spend some time on other stuff.

The graphical console in Cloudmin has a Flash and Java version (both of which I also hate), but they do work, and we are able to distribute them. There are several new-ish HTML5/JavaScript VNC clients out there, most of which aren’t suitable for various reasons (licensing, Java on the server-side or other server-side dependencies that are untenable). But, I just found noVNC, while googling to be sure we weren’t missing anything promising. This one actually looks very good for our needs. I’m gonna experiment with it soon and will hopefully be able to work on adding it as an option. I would love to kill Flash and Java in everything we ship. The only good thing about them is that they work (or did, historically), and were available. Also Jamie is very comfortable with Java, which is not true of anybody else working on Webmin/Virtualmin/Cloudmin.

Oh, also, I don’t know about the bug in the file manager…did you ever file a ticket about it? I don’t remember it ever coming up in our weekly meetings, so I’m not sure any of us were ever aware of it. I try to stay on top of the forums, but I sometimes miss stuff because we get so much mail, forum traffic, tickets, etc. that three of us can’t really keep up with all of it…filing bugs about bugs makes it much easier for us to know when we’ve missed something important; deleting /etc would be really freakin’ important).

And, Jamie is under orders to stay out of the forums unless we link him to them for a specific thing, because it’s such a tie sink and we need him coding every free moment. So, if me or Eric don’t catch a bug mention and escalate it to the ticket tracker, it doesn’t get caught. So, put bugs into the tracker when you find them.

Thanks for your answers. No I didn’t file a bug, at that time was so angry that I dropped Cloudmin :slight_smile: BTw tried a few times the Ajax ssh stuff. It is awfull, at least on openSuse 13.1 x64 and latest Chromium: can’t do shit, pardon me, because of some weird lag, which prevents me even typing; and when updating for example or running anything for a long time, it freezes. It is unusable and kind of scary.

I can’t stress enough the need for a new file manager with an integrated editor. We are still waiting, you must aggree here, that this discussions are going on for years now…

I promise not to post anything in the forums for a whole year, and spare you of my “feedback”, if you would solve this one

Hi fakemoth

Thanks for the url https://www.digitalocean.com/community/tutorials/how-to-configure-proftpd-to-use-sftp-instead-of-ftp

ProFTPd is already configured and used in my VirtualMin instance.
Secondly, the proftpd.conf file is located under /etc/ and not in /etc/proftpd/
So can I just create the sftp.conf file in /etc/???

Thanks in advance.

  • Tim

Hi fakemoth

So you just added the configuration from the sftp.conf directly in the /etc/proftpd.conf file?

    SFTPEngine on
    Port 2222
    SFTPLog /var/log/proftpd/sftp.log

    # Configure both the RSA and DSA host keys, using the same host key
    # files that OpenSSH uses.
    SFTPHostKey /etc/ssh/ssh_host_rsa_key
    SFTPHostKey /etc/ssh/ssh_host_dsa_key

    SFTPAuthMethods publickey

    SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u

    # Enable compression
    SFTPCompression delayed
  • Tim

Well I didn’t create anything, I just added to the main proftpd.conf :wink: But I suppose you can as long as you specify the path.

Yes, But in my case I wanted users to login by using their old FTP/SFTP password so replace the coresponding section with:

SFTPAuthMethods password #SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u

To be clear: this it to use passwords (like in FTP) for logins. And you can drop also the generating access keys part, unless you really want it and need it. I was after the smoothest transition possible for my users and so it was.

Hi fakemoth

Just what I need.
All our users are using FTP (at the moment) but some have asked for the SFTP option, but still want to use the old username / password as you describe above.
When adding the configuration to the proftpd.conf file, do I need to be aware of any changes within the virtualmin users area, when creating new users for SFTP usage?

  • Tim

Hi fakemoth

Hmm, I added the following to the /etc/proftpd.conf file

    SFTPEngine on
    Port 2222
    SFTPLog /var/log/proftpd/sftp.log
    
    SFTPAuthMethods password

    # Enable compression
    SFTPCompression delayed

did a /etc/init.d/proftpd restart
created a new user (FTP only) and tried to logon with that on port 2222
no success… :frowning:

No connection could be make because the target machine actively refused it.

So where did it go wrong?
Do I have to create the user as an user on the server instead?
Please be advised that I do the SFTP on port 2222 internal so there is no firewall rules in between.

  • Tim

No other changes (for the first question).

Hmmm, are you sure you are connecting with some client that is SFTP aware, can you test with Filezilla for example? And yes the user should be a system user, locally created, just like for FTP… I don’t think I get it…

You should get at least the pop-up about the SSH keys, did you got that? What are your logs saying?

Hi fakemoth

In the bottom of the /etc/proftpd.conf file I have added the following lines

    SFTPEngine on
    Port 2222
    SFTPLog /var/log/proftpd/sftp.log

    # Configure both the RSA and DSA host keys, using the same host key
    # files that OpenSSH uses.
    #SFTPHostKey /etc/ssh/ssh_host_rsa_key
    #SFTPHostKey /etc/ssh/ssh_host_dsa_key

    #SFTPAuthMethods publickey

    SFTPAuthMethods password
    #SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u

    # Enable compression
    SFTPCompression delayed

Have I commented to much out?

I have tried with filezilla as described in the tutorial URL you sent to me.
https://www.digitalocean.com/community/tutorials/how-to-configure-proftpd-to-use-sftp-instead-of-ftp

Network error:Software caused connection abort

I don’t get any popup regarding SSH keys?
The following error I see in the /var/log/proftp/sftp.log

Mar 16 15:55:50 mod_sftp/0.9.7[14209]: no available host keys, unable to handle session

I have also commented out the following line in /etc/ssh/sshd_config

Subsystem sftp /usr/lib/openssh/sftp-server

  • Tim

You can check to see if it’s listening on that port:

netstat -ln | grep 2222

And, then, if it is, you can check to see if it’s accessible from your client machine (maybe there’s a firewall you don’t know about):

nmap address.of.server

I would also check the proftpd log and messages for any clues about failures.

Yeah you did:

    SFTPEngine on
    Port 2222
    SFTPLog /var/log/proftpd/sftp.log

    # Configure both the RSA and DSA host keys, using the same host key
    # files that OpenSSH uses.
    SFTPHostKey /etc/ssh/ssh_host_rsa_key
    SFTPHostKey /etc/ssh/ssh_host_dsa_key

    #SFTPAuthMethods publickey

    SFTPAuthMethods password
    #SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u

    # Enable compression
    SFTPCompression delayed

Those are your servers keys :slight_smile: I was refering to the client keys, for authentication only with keys, nvm I corrected it for you. Also be sure, that is the actual location for your keys (check if they are there).

Second please comment back the line for SSH, like this. And just forget about the regular SSH - that is where you get a shell; in the SFTP module from proftpd you don’t.

# Subsystem sftp /usr/lib/openssh/sftp-server

Hi Joe

When I do the following command

netstat -ln | grep 2222

I don’t see anything…
So it looks like it doesn’t listening on port 2222 even though I have added it to the proftpd.conf file.

  • Tim

Hi fakemoth

I have changed the proftpd.conf file as described above, added in the bottom of the file.

    SFTPEngine on
    Port 2222
    SFTPLog /var/log/proftpd/sftp.log

    # Configure both the RSA and DSA host keys, using the same host key
    # files that OpenSSH uses.
    SFTPHostKey /etc/ssh/ssh_host_rsa_key
    SFTPHostKey /etc/ssh/ssh_host_dsa_key

    #SFTPAuthMethods publickey

    SFTPAuthMethods password
    #SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u

    # Enable compression
    SFTPCompression delayed

I have also commented the line for SSH again (/etc/ssh/sshd_config) so it looks like the following.

Subsystem sftp /usr/lib/openssh/sftp-server

The SSH keys are located in the folder as setup in the config file.

Then I have restarted the proftpd service.

The command netstat -ln | grep 2222 doesn’t give me anything.

Secondly i don’t get any new log in /var/log/proftp/sftp.log and FileZilla still gives me the error : Network error: Connection refused.

What do I do wrong here?

It should be easy to setup doing the above changes, but I can’t get it to work…

  • Tim

Hi Joe and fakemoth

Regarding firewall, I don’t have the firewall (iptables) active on the virtualmin server and the client I am using is on the same network, 2 ip’s in between. So no Internet, WAN or anything in between.

  • Tim

Hi

I have given up to get ProFTPD to work with SFTP.
It will not start the SFTPengine on port 2222, no error logs or anything useful.

  • Tim

Well there isn’t really nothing else to it, so… I don’t know what to say. I still think that somehow you have that port closed… or something… you aren’t in the same VLAN maybe or stuff like that… I really can’t say - but you should try to make it work as I would mark it as"critical".

Try it on a test machine also? Or in a virtual one?