Is there way to tell if CS is currently in my box?

Just curious if there is a quick and dirty way to determine if Vera customer support (or anyone else) is logged into my Vera. By the time they respond to any trouble tickets they’re long gone. I’d like to know if/when they’re in there, so I know they’re actively working on my issue.

There is no easy way to do this.
You can use some unix tools if you are familiar with them …
You need to SSH into your Vera and monitor for new/additional (besides your self) ssh sessions.

Here is what I do on ALL of my Linux boxes and routers to know when someone logs into it.

When someone/something logs into your box, it will automatically send you an email using with their IP and time.

I’m sure you can use other providers than gmail, you just need to tweak the settings below.

I recommend to create a new gmail account to act as your mail server. You can use your own, BUT your email password will be saved in a text file and you don’t want someone being able to read your email if they see this file. When you create this new account, all it will do is be a place where your Vera can send an email through. Call it whatever you want, for this example, I will use notify8675309@gmail.com. Get the account working so you can log into it. Note your email address and password.

Now for the magic. :slight_smile:

  1. SSH into your vera or use WinSCP.
  2. Edit /etc/msmtprc (nano /etc/msmtprc); Replace everything with the text below:

account default

host smtp.gmail.com
port 587
auth on
user notify8675309@gmail.com
password password8675309

auto_from off
from notify8675309@gmail.com

tls on
tls_starttls on
tls_certcheck off

logfile
syslog LOG_MAIL
  1. Save and Exit

  2. Edit /etc/profile (nano /etc/profile); Insert the following code after the banner. Should be close to line 4.

ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
logger -t ssh-wrapper $USER login from $ip
echo -e "Subject: MyVera Root Login - \r\n\r\nUser $USER just logged in from $ip" |msmtp --from=default -t youremailaddress@gmail.com

If you want to send to another email/text like your cellphone, just duplicate the last line and modify for your taste.

  1. Save and Exit
  2. Restart your Vera.

To test:

SSH into your Vera and check your email.

You should have an email from your Vera. If you don’t, you need to change your new account your just setup to allow less secure apps to access your account ([url=https://support.google.com/accounts/answer/6010255?hl=en]Less secure apps & your Google Account - Google Account Help)

Hope it helps

boB