LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 10-16-2015, 09:42 AM   #16
jamtat
Member
 
Registered: Oct 2004
Distribution: Debian/Ubuntu, Arch, Gentoo, Void
Posts: 138

Original Poster
Rep: Reputation: 24

Quote:
Originally Posted by Sefyir View Post
I would suggest a few things as well:
  • Make the VPS key-based to login to the server through ssh
  • Setup a firewall to only allow access to xmpp and ssh ports. 22 for ssh and I believe 5269 and 5222 for xmpp. Xmpp may need more.
Right. Was planning on shared-key authentication. I'll have to study up on firewalling but do have at least a bit of experience with iptables. I was actually thinking of running ssh on an alternate port as well. And so far as I understand it, port 5269 is so that xmpp can communicate with other xmpp servers, which will not be necessary in my scenario. So I was thinking of opening only port 5222.
Quote:
Originally Posted by Sefyir View Post
  • Close xmpp registrations so you have to manually set up accounts. (There should only be two users)
That's just what I was planning to do.

I'd also need to decide which distro to run there. I use mostly Arch these days so I initially thought of using that. But I've run Debian/Ubuntu for years as well and have begun to wonder whether, since so many of the how-to's I run across on the web are oriented toward Ubuntu--including the prosody how-to we've discussed in this thread--it might not be better to go with it. Which do you use?

Last edited by jamtat; 10-16-2015 at 10:05 AM.
 
Old 10-16-2015, 05:48 PM   #17
jamtat
Member
 
Registered: Oct 2004
Distribution: Debian/Ubuntu, Arch, Gentoo, Void
Posts: 138

Original Poster
Rep: Reputation: 24
Also, a coupla questions about SSL/TLS as stipulated in the how-to. It makes clear that using SSL/TLS (in order for clients to authenticate before they can log into the server?) is optional. He also mentions that OTR encryption can be used in addition to SSL/TLS for super-secure instant messaging. I'm just trying to ascertain that I understand correctly all these pieces of the puzzle and which are necessary and which optional.

Here's what I'm gathering at the moment. First, this whole scheme can work without either SSL/TLS or OTR encryption in the client, correct? The SSL/TLS piece is being implemented to make it more difficult (impossible?) for someone to masquerade as an authorized user on the system, yes? And the OTR encryption part can be implemented to keep middlemen who might intercept the IM stream from deciphering it, correct? And, finally, with regard to SSL/TLS: implementing this will necessitate that only certain clients capable to that sort of authentication will be able to log into the server, correct? I.e., enabling this might preclude use of certain older clients, yes?

Furhter input will be appreciated.

Last edited by jamtat; 10-16-2015 at 06:12 PM.
 
Old 10-16-2015, 06:53 PM   #18
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Smile

I use debian stable 7. Debian 8 is out and if you're ok with systemd, use that. Debian stable is well known for its stability and you should expect services there to run without some random crash - solid but it will likely be a old version. This shouldn't be a issue however since you're not looking for the newest features. If it really bothers you, you can always compile your own (requiring increased maintenance). As for arch.. well it's your server, but if you're looking for less work... go with debian
So my suggestion is - use debian and whatever is in the repo. Assuming for a moment you use prosody, install is as simple as apt-get install prosody.
Conveniently, when it comes to configuring programs ubuntu is similar to debian (it is a derivative of it!)
Quote:
It makes clear that using SSL/TLS (in order for clients to authenticate before they can log into the server?) is optional.
It is optional, but if you don't the authentication will probably occur in clear text. This could include your username and password in clear text. If you ever plan on using a non-secured wifi (like a public wifi.. anywhere) it is trivial to steal your authentication.
The reasons not to are generally:

Self-signed shows a error and getting a "official" one is too expensive/extra work.
You plan on having two users. Once you accept the self-signed certificate (pidgin is one-time), it should not bother you again. The encryption however still applies. While you're at it, double check everything lines up. I would suggest using it unless you're 100% certain you will never be using any public wifi and completely trust your connection to the server. That's a lot of worry over something that is easily remedied for such a small user base. If the error bugs you, Startssl provides free certs. But you must have a domain for this to apply!
So... generate a self-signed cert and use it. It'll provide very little trouble and a lot of extra security at no cost.

As for OTR, this link may explain it a little bit https://otr.cypherpunks.ca/help/4.0....ls.php?lang=en

You don't have to require encryption. In prosody there is a option - --c2s_require_encryption, to permit usage of non-encryption. That should permit usage with older clients.

Quote:
I was actually thinking of running ssh on an alternate port as well. And so far as I understand it, port 5269 is so that xmpp can communicate with other xmpp servers, which will not be necessary in my scenario. So I was thinking of opening only port 5222.
You can, but alternate port is security by obscurity and easily discovered. If you want to minimize brute force attempts, there are a few tricks you can do with iptables and ssh to secure it. I can list my iptables rules if you're interested as they've been effective for me. The #1 thing to fix that is with public key access and not allowing passwords.

In summary so far (so I can keep track, this is a interesting thread for me as a method of autonomy and communication between small groups)
  • Using very low-end VPS and static ip as host
  • Opening ports 22 (ssh) and 5222 (xmpp client to server).
  • Installation of xmpp server (prosody in my use)
  • Generating self-signed certificates
  • Adding users accounts and usage of ip address instead of domain (eg foo@42.523.66.33 instead of foo@bar.org)
  • Add user to client and accepting self-signed certificates manually (since it'll present a error when adding a user to client - not when adding a friend however)
  • Setting up OTR between everyone

Last edited by Sefyir; 10-16-2015 at 09:43 PM.
 
Old 10-17-2015, 08:25 AM   #19
jamtat
Member
 
Registered: Oct 2004
Distribution: Debian/Ubuntu, Arch, Gentoo, Void
Posts: 138

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by Sefyir View Post
I use debian stable 7. Debian 8 is out and if you're ok with systemd, use that. Debian stable is well known for its stability and you should expect services there to run without some random crash - solid but it will likely be a old version. This shouldn't be a issue however since you're not looking for the newest features. If it really bothers you, you can always compile your own (requiring increased maintenance). As for arch.. well it's your server, but if you're looking for less work... go with debian
So my suggestion is - use debian and whatever is in the repo. Assuming for a moment you use prosody, install is as simple as apt-get install prosody.
Conveniently, when it comes to configuring programs ubuntu is similar to debian (it is a derivative of it!)
Yeah, Debian stable. I should have thought of that. I don't like systemd, but have been forced to come to terms with it under Arch. I know from personal experience that Ubuntu is a derivative of Debian: years ago, after having experimented with Mandrake, Red Hat, Redmond Linux (remember that one?), and various Slackware derivatives, I'd finally settled on Debian as my distro of choice. It was about a year after I'd begun running Debian unstable that Ubuntu came out. I stuck with Debian for awhile longer but, once I began to experience system breakages that required sometimes-lengthy troubleshooting sessions to restore the system to functionality, I decided to switch over to Ubuntu; it had the up-to-date packages Debian stable and experimental lacked, but offered much better stability than unstable.
Quote:
Originally Posted by Sefyir View Post
Self-signed shows a error and getting a "official" one is too expensive/extra work.
You plan on having two users. Once you accept the self-signed certificate (pidgin is one-time), it should not bother you again. The encryption however still applies. While you're at it, double check everything lines up. I would suggest using it unless you're 100 certain you will never be using any public wifi and completely trust your connection to the server. That's a lot of worry over something that is easily remedied for such a small user base. If the error bugs you, Startssl provides free certs. But you must have a domain for this to apply!
So... generate a self-signed cert and use it. It'll provide very little trouble and a lot of extra security at no cost.
This looks like a good set of directives for generating a self-signed certificate: https://help.ubuntu.com/12.04/server...-security.html What do you think?
Quote:
Originally Posted by Sefyir View Post
You can, but alternate port is security by obscurity and easily discovered. If you want to minimize brute force attempts, there are a few tricks you can do with iptables and ssh to secure it. I can list my iptables rules if you're interested as they've been effective for me. The #1 thing to fix that is with public key access and not allowing passwords.
I'd like to go with dropbear, given the fairly paltry system resources of this VPS. I'm still trying to figure out how to make it use public key authentication only. I guess maybe you forgot but I already, subsequent to another thread on this forum where we discussed firewalling by means of iptables, appropriated some of your firewall rules on another machine of mine. So I know where to find them Thanks

LATER EDIT: looking over the man page for dropbear, it looks like the way to force public key authentication is to pass it the -s option. Passing the -w option disables root logins. Under Ubuntu, those switches can be passed by editing /etc/default/dropbear.

Last edited by jamtat; 10-17-2015 at 08:48 AM.
 
Old 10-17-2015, 08:42 AM   #20
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Has anybody mentioned Firefox Talk yet? I've only tested it and it seems there may be problems with AddBlock or NoScript but otherwise it seems fine.
Personally I use BBM on my Blackberry (as I am now) and I would be expressely forbidden to install or run anything on either of my work machines unless approved my a committee.
 
Old 10-17-2015, 12:58 PM   #21
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
Quote:
Originally Posted by Sefyir View Post
You can, but alternate port is security by obscurity and easily discovered. If you want to minimize brute force attempts, there are a few tricks you can do with iptables and ssh to secure it. I can list my iptables rules if you're interested as they've been effective for me. The #1 thing to fix that is with public key access and not allowing passwords.
I would have to say that running on a non-standard port is still a good idea. I've been running SSH on my home server for over a year on a random port, and I don't think I've had a single unauthorized login attempt.

So while it should by no means be your only method of securing SSH, I would still recommend running SSH on some port other than 22.

Quote:
Originally Posted by 273 View Post
Has anybody mentioned Firefox Talk yet? I've only tested it and it seems there may be problems with AddBlock or NoScript but otherwise it seems fine.
Personally I use BBM on my Blackberry (as I am now) and I would be expressely forbidden to install or run anything on either of my work machines unless approved my a committee.
If you're looking for alternatives (and have access to a webserver) you might want to look at phpfreechat. Since it's web-based, it shouldn't require any special software other than a web browser.
 
Old 10-17-2015, 07:20 PM   #22
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by jamtat View Post
This looks like a good set of directives for generating a self-signed certificate: https://help.ubuntu.com/12.04/server...-security.html What do you think?

I'd like to go with dropbear, given the fairly paltry system resources of this VPS. I'm still trying to figure out how to make it use public key authentication only. I guess maybe you forgot but I already, subsequent to another thread on this forum where we discussed firewalling by means of iptables, appropriated some of your firewall rules on another machine of mine. So I know where to find them Thanks
Yup, you could also use this one-liner. For common name, you'll probably want to use the servers ip address.

Code:
openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem
Curious why using dropbear over openssh. openssh is developed by OpenBSD - essentially the go to if you want solid security and is installed by default like anywhere... It works well on my raspberry pi which is very low power. The greatest usage of time would probably be the encryption method rather then the rest of it.

Quote:
I would have to say that running on a non-standard port is still a good idea.
There's nothing inherently wrong and against mass attacks would be a effective deterrent. I suppose my other argument is convenience as it would require remembering where the new port or configuring it. Then later if you try to login on a different computer and forget the port could create some un-needed stress. (IMO)
Past rsa only auth, my favorite move is the usage of AllowUsers, which only permits certain users to login and denies everyone else.
Commonly I'll do something like

Code:
AllowUsers sefyir
and occasionally get login attempts that all fail because they're not in the AllowUsers. Very effective
Code:
-> User root from 186.64.xx.xx not allowed because not listed in AllowUsers

Last edited by Sefyir; 10-17-2015 at 07:30 PM.
 
Old 10-18-2015, 08:43 AM   #23
jamtat
Member
 
Registered: Oct 2004
Distribution: Debian/Ubuntu, Arch, Gentoo, Void
Posts: 138

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by Sefyir View Post
Yup, you could also use this one-liner. For common name, you'll probably want to use the servers ip address.

Code:
openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem
Wait, I'm getting confused. The relevant files referenced in the prosody how-to we've been discussing and as designated in /etc/prosody/prosody.cfg.lua are /etc/prosody/certs/localhost.cert and /etc/prosody/certs/localhost.key (to which the how-to adds /etc/prosody/certs/dh-2048.pem), right? So what role do your files key.pem and cert.pem play in relation to these? Where are key.pem and cert.pem to be placed and how referenced in /etc/prosody/prosody.cfg.lua? I don't understand terribly well this encryption stuff, as I've mentioned, so am trying to follow step-by step instructions. The files created at the Ubuntu how-to I referenced are named server.key, server.key.secure, server.key.insecure, server.csr, and server.crt, and two of those are to be copied to /etc/ssl/certs and /etc/ssl/private (adapting those directives to my task, I've been assuming that server.key and server.crt should replace /etc/prosody/certs/localhost.cert and /etc/prosody/certs/localhost.key). All this gets a bit confusng to someone who has already only a vague conception concerning these matters.

Also, you speak of "common name," but what is asked for in creation of these keys is FQDN. So, is "common name" synonymous with FQDN for purposes of this task? Such that when it asks for FQDN I put there the IP of my VPS, something like 10.20.30.40?

Quote:
Originally Posted by Sefyir View Post
Curious why using dropbear over openssh. openssh is developed by OpenBSD - essentially the go to if you want solid security and is installed by default like anywhere... It works well on my raspberry pi which is very low power. The greatest usage of time would probably be the encryption method rather then the rest of it.
I'm intending to go with dropbear because it is a low-resource application and this VPS is a low resource system. I'm not absolutely insisting on it, it just seemed like a good idea. I'm aware that dropbear does not have all the capabilites that openssh has, but it seemed its capabilities might suffice for purposes of administering this VPS. That said I'm not trying to rule out consideration of the alternative.

LATER EDIT: found this http://prosody.im/doc/certificates, which contains relevant information.

Last edited by jamtat; 10-18-2015 at 03:03 PM.
 
Old 10-18-2015, 09:20 AM   #24
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Encryption with modern IM clients is transparent. You just need a shared secret between you, such as a question and answer. Once set up, you don't even know about the encryption. IM+ on Android and iOS is a good client. I don't know much about Windows because I don't use it, but it does have a browser extension. Mostly I use Google Hangouts for IM with family. We all use it for chatting and for video conferencing. That's how we get to see the grandchildren daily, or nearly, from long distance. It also works on phones and tablets. On a Windows machine you may need to keep Chrome browser open, I don't really know. For texting, I use Pushbullet. It installs on your phone and on PC, and I can send and receive texts on my PC. The phone keyboard is a major PITA for me, and I avoid it if possible.
 
Old 10-18-2015, 11:09 AM   #25
jamtat
Member
 
Registered: Oct 2004
Distribution: Debian/Ubuntu, Arch, Gentoo, Void
Posts: 138

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by maples View Post
If you're looking for alternatives (and have access to a webserver) you might want to look at phpfreechat. Since it's web-based, it shouldn't require any special software other than a web browser.
What an interesting suggestion. Setting up apache with authorzation--something I've managed to do recently--could be a decent way of having semi-secure communications with select users in combination with this software. I'm going to continue looking into this--thanks for the suggestion.
 
Old 10-18-2015, 06:45 PM   #26
jamtat
Member
 
Registered: Oct 2004
Distribution: Debian/Ubuntu, Arch, Gentoo, Void
Posts: 138

Original Poster
Rep: Reputation: 24
Looks like I got everything configured right and am up and running with this new instant messaging solution (with the exception of implementing OTR clients, something I will experiment with soon). I ended up going with an Ubuntu 14.04 server LTS installation for this. Thanks for all the help offered in this thread.

One clarification regarding iptables rules. Seyfir's recipe for defeating bots attempting ssh connections looks as follows:
Code:
-A INPUT -p tcp --dport 22 ! -s 192.168.1.1/24  -m recent --name SSH --update --seconds 10 --hitcount 3 --rttl -m conntrack --ctstate NEW -j DROP
This is clearly written with a view to having a certain set of local network addresses be exempt from the drop policy--namely 192.168.1.1/24. That part of the rule, however, is inapplicable to the VPS situation where I'm setting this up, since there's no LAN in play there. So part of that stanza needs to be removed. My rather sketchy comprehension of iptables rules indicates that I could remove the ! -s 192.168.1.1/24 part of this rule and leave the rest intact, thereby winding up with a rule that will accomplish the end at which I'm aiming (dropping ssh log-in attempts that occur more frequently than twice in a 10 second interval). So, is my deduction about that correct?

Last edited by jamtat; 10-18-2015 at 06:47 PM.
 
Old 10-18-2015, 08:22 PM   #27
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by jamtat View Post
remove the ! -s 192.168.1.1/24 part of this rule and leave the rest intact .. So, is my deduction about that correct?
So, is "common name" synonymous with FQDN for purposes of this task?
Yup and yup
make sure to ensure a method of access in case you bork the iptables rules and prevent access to the server (like a crontask of resetting rules) unless you have some alternate access to it.
Then test it

Edit:
Quote:
If you're looking for alternatives (and have access to a webserver) you might want to look at phpfreechat. Since it's web-based, it shouldn't require any special software other than a web browser.
What an interesting suggestion. Setting up apache with authorzation--something I've managed to do recently--could be a decent way of having semi-secure communications with select users in combination with this software. I'm going to continue looking into this--thanks for the suggestion.
You might even try conversejs. Basically, it's a xmpp client but browser based. That way you can use a cli-based one (or whatever) and whoever else just use the web one. The problem here would be having to setup a webserver which invites its own whole field of complexity. I just tried it and it's basically a clone of https://conversejs.org/ itself. Nifty!

As for installing apache - watch that ram. apache uses a lot and could overwhelm a low-end VPS.

Further edit:
JappixApp has a pretty nice browser based xmpp client. It feels like a actual program meant for xmpp (opposed to conversejs, which is meant to be integrated into stuff).

Last edited by Sefyir; 10-20-2015 at 05:26 PM.
 
  


Reply

Tags
instant messaging



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Haiku: BeOS for the 21st Century LXer Syndicated Linux News 0 12-31-2012 07:41 PM
LXer: It's the 21st Century. Do you know where your files are? LXer Syndicated Linux News 0 04-12-2010 06:11 PM
21st century Iwo Jima.! Hitboxx General 3 12-25-2007 01:43 AM
21st century nationalism primo General 81 03-23-2006 11:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 12:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration