Solved

Message before/on login

Posted on 2012-03-28
3
473 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 500 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

830 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