Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Message before/on login

Posted on 2012-03-28
3
Medium Priority
?
503 Views
Last Modified: 2012-08-14
Is it possible to display a message before login on Ubuntu?

On startup of my Ubuntu server, I have:-
Ubuntu 11.10 ubbuntu tty1

Ubuntu login: _

What Id like it to display is its IP address, so something like:-
Ubuntu 11.10 ubbuntu tty1
IP address - 192.168.1.32
Remote Administration on 192.168.1.32:10000
Default Username/Password: user1/pwd1

Ubuntu login: _
(Where its IP address retrived from DHCP id 192.168.1.32)


And then once logged in, display a message such as:-
This is a private server, if you should not be here, please leave.

Ive read that there are scripts that run at the times I need, but I dont know what they are, or what they are called.

I also dont know how to 'echo' out these commands, Im assuming something like:-
echo Remote Administration on 192.168.1.32:10000

Open in new window

, but I also dont know how to retrive just the IP address.

Sorry for not knowing much on this, and asking soo much on this one question!

Thank you
0
Comment
Question by:tonelm54
3 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37776419
Believe me,

you really don't want to tell just anybody who's able to reach your server via telnet a username and matching password!
0
 

Author Comment

by:tonelm54
ID: 37776888
True, although really the purpose is to put the ip address in, so once the server is put in on site a keyboard isn't required to set it up, instead I can use another pc to configure a static ip and set it up.

Thank you
0
 
LVL 5

Accepted Solution

by:
1ly4me earned 2000 total points
ID: 37777758
To customize your TTY login edit /etc/issue file . For more info
#man getty
To customize login messages edit /etc/motd file. its better to run a cron job for specific IP and dump the output to /etc/motd file
For Ex, in crontab,
10 * * * *  echo 'This is a private server, if you should not be here, please leave' > /etc/motd

Open in new window

This cron will run for very five 10 minutes and dump output to /etc/motd
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question