LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2010, 12:34 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
Display a legal warning before login.


How would i force All connection oriented network services to display a legal warning in terms of banner before any fuctional operation by user?
 
Old 10-05-2010, 12:38 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
List the services !!
 
Old 10-05-2010, 12:41 AM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
For FTP server:

To change the greeting banner for vsftpd, add the following directive to the /etc/vsftpd/vsftpd.conf file:

Quote:
ftpd_banner=<insert_greeting_here>
Replace <insert_greeting_here> in the above directive with the text of the greeting message.

For mutli-line banners, it is best to use a banner file. To simplify management of multiple banners, place all banners in a new directory called /etc/banners/. The banner file for FTP connections in this example is /etc/banners/ftp.msg. Below is an example of what such a file may look like:

####################################################
# Hello, all activity on ftp.example.com is logged.#
####################################################

For SMTP(if using postfix)

edit /etc/postfix/main.cf

Quote:
smtpd_banner = $myhostname ESMTP $mail_name\n
\n System Info: This is a Postfix mail server\n . running a multiline SMTP greeting patch\n
\n Please don't send me SPAM here - we don't like it
For SMTP(if using sendmail)

define(`confSMTP_LOGIN_MSG', `somehost.com \n System is being Monitored')dnl

Telnet greeting message:

Quote:
Edit file /etc/issue
SSH : Secure shell login greeting message:

Quote:
Edit file /etc/ssh/sshd_config
Edit/enable the line: Banner /etc/issue
Restart sshd: service sshd restart
GDM login message:
Quote:
Edit /etc/X11/gdm/gdm.conf as shown above. Configure "Welcome" option.

Last edited by prayag_pjs; 10-05-2010 at 12:54 AM.
 
Old 10-05-2010, 12:49 AM   #4
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by prayag_pjs View Post
For FTP server:

To change the greeting banner for vsftpd, add the following directive to the /etc/vsftpd/vsftpd.conf file:



Replace <insert_greeting_here> in the above directive with the text of the greeting message.

For mutli-line banners, it is best to use a banner file. To simplify management of multiple banners, place all banners in a new directory called /etc/banners/. The banner file for FTP connections in this example is /etc/banners/ftp.msg. Below is an example of what such a file may look like:

####################################################
# Hello, all activity on ftp.example.com is logged.#
####################################################

For SMTP(if using postfix)

edit /etc/postfix/main.cf



For SMTP(if using sendmail)

define(`confSMTP_LOGIN_MSG', `somehost.com \n System is being Monitored')dnl
I would like it for SSH since its been use by many user.
 
Old 10-05-2010, 03:39 AM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
This is what i did and it worked sharing for others.

Create a file called /etc/ssh/sshd-banner.

Paste the customized banner message in it.
For example:
Quote:
"This Machine is for the exclusive use of XYZ organization and Unauthorized access or breach of these terms may result in termination of your authorization and/or criminal penalties."
edit /etc/ssh/sshd_config with following entry

Banner /etc/ssh/sshd-banner


Restart sshd service using.

Quote:
#service sshd restart
To validate the changes:
Try to login to the server using putty.
put username and press enter .
You should get banner displaying text under /etc/ssh/sshd-banner file.

For example:

Quote:
login as: root
This site is for the exclusive use of Oracle and its authorized customers and partners. Use of this site by customers and partners is subject to the Terms of Use and Privacy Policy for this site, as well as your contract with Oracle. Use of this site by Oracle employees is subject to company policies, including the Code of Conduct. Unauthorized access or breach of these terms may result in termination of your authorization to use this site and/or civil and criminal penalties.
root@'s password:
 
  


Reply



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
[SOLVED] Gtk-WARNING **: cannot open display: :0.0 toxine Debian 23 08-06-2019 09:59 PM
export display and Gtk-WARNING **: cannot open display: zimma Linux - Server 0 04-24-2009 02:51 AM
Gtk-WARNING **: cannot open display iamjoepesci Red Hat 2 10-17-2008 11:51 AM
GTK-Warning ** cannot open display kgblossom Debian 6 02-18-2007 02:23 PM
Gtk-WARNING **: cannot open display: lijomali Fedora 6 11-10-2005 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:42 PM.

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