Solved

User Origination

Posted on 2003-11-11
3
306 Views
Last Modified: 2010-04-21
I want to change the .bashrc file so that it sets something up different depending upon if you're coming from one ip or another.  How do you find out which remote ip is telnetted into the current terminal?  Thanks in advance.
0
Comment
Question by:mnashadka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Expert Comment

by:willy134
ID: 9726188
if you do a
who -T
it will tell you what remote ip the user is coming from.

Unfortunately it lists all users currently logged on.  And when you are on the localhost it stats (0:0)

That answer is off the top of my head.  Give me some time to research it and I may find something else.  Unless someone already knows the answer.
0
 
LVL 24

Accepted Solution

by:
shivsa earned 125 total points
ID: 9729318
place this in your script.

PORT_ID=`who -m |awk '{print $6}' |sed "s/^(// ; s/)$//"`
0
 
LVL 8

Author Comment

by:mnashadka
ID: 9731822
Thanks shivsa.  That did the trick.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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 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

623 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