Post Closed as "unclear what you're asking" by Anthon, Michael Homer, Networker, jimmij, Ramesh
7 if this is working then clearly /etc/profile was used, not /etc/profiles
source | link

I want to get notified if any person accesses my debianDebian server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profilesprofile:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too goodwell: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

I want to get notified if any person accesses my debian server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

I want to get notified if any person accesses my Debian server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profile:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too well: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

6 added 7 characters in body
source | link

I want to get notified if any person accesses my debian server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

I want to get notified if any person accesses my server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

I want to get notified if any person accesses my debian server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

5 added 71 characters in body
source | link

I want to get notified if any person accesses my server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

I want to get notified if any person accesses my server via ssh.

So I want to send an email whenever a user logs in on my server via ssh, so I added this line at the end of /etc/profiles:

/usr/local/bin/shell-login.sh | mailx -s "SSH Login User $(whoami) on YOUR-HOSTNAME" your@email.org

/usr/local/bin/shell-login.sh contains:

#!/bin/bash

echo "Login on $(hostname) at $(date +%Y-%m-%d +%H:%M)"
echo "User: "$(whoami)
echo
id
echo
finger

This works too good: I get an email every minute now telling me that root is logging in, which seems to be caused by cron (see /var/log/auth.log)

How do I have to change this setup to send no emails on automated internal ssh-calls?

4 added 21 characters in body
source | link
3 added 61 characters in body
source | link
2 deleted 35 characters in body
source | link
1
source | link