Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Terminal Security?

Terminal Security?
Thread Tools
headbirth
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
May 26, 2005, 01:34 PM
 
Why does Terminal show my connection at the prompt when I'm either connected via dialup or airport?

Is this a security issue?
     
piracy
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
May 26, 2005, 01:36 PM
 
No.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 26, 2005, 01:43 PM
 
What do you mean it "shows your connection"? I haven't noticed my PowerBook doing anything special when I'm connected to an Airport network.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Kvasir
Forum Regular
Join Date: May 2005
Status: Offline
Reply With Quote
May 26, 2005, 01:45 PM
 
Originally Posted by headbirth
Why does Terminal show my connection at the prompt when I'm either connected via dialup or airport?

Is this a security issue?
You can make the prompt anything you want. My terminal is green text on a black background, but my prompt is yellow text, like this:

<day of the week> month/date <userid>
<path of current directory> ->

eg.

Thu. 05/26 testuser
/usr/local/bin ->


Search www.osxfaq.com for custom terminal prompt, or some such keywords.
     
headbirth  (op)
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
May 26, 2005, 03:24 PM
 
I'm not talking about the colors.

When not connected it gives my name at the prompt (johndoe!) when connected it gives something like (dialup-4: johndoe!) or even some other odd names when connected to public networks.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 26, 2005, 03:34 PM
 
Because that is the host name of your computer at that time. As of 10.4, it will try and establish the host name thus:
  1. If the DHCP or BootP server for the primary IP address provides a name, use that.
  2. If there is a valid name returned by a reverse DNS query for the primary IP address, use that.
  3. The local hostname specified in the Sharing pane.
  4. The name "localhost"
You're probably getting the name from 2 or 1. You can override this setting by editing /etc/hostconfig and changing it from AUTOMATIC to something you specify.

This is not a security risk, as all that information is determinable anyway.
     
Big Mac
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
May 26, 2005, 10:14 PM
 
It definitely is not a security risk, but I don't know why that value will replace your Mac's Rendez, er, Bonjour name, which is what is usually used in Terminal. It never happens when I am connected through Airport (at least in Panther), but it does happen (at least sometimes) when I am connected through ethernet. Why not leave the Bonjour name?

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
headbirth  (op)
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
May 27, 2005, 07:25 AM
 
So, my understanding here i that my ISP or the network administrator has assigned this name to my connection. Correct?
     
FeralCat
Fresh-Faced Recruit
Join Date: Feb 2005
Location: Illinois, USA
Status: Offline
Reply With Quote
May 27, 2005, 07:48 AM
 
More like that is the name that the IP address your ISP provided to you resolves to through DNS. You can change the prompt, as people have said. I believe you want to change the PS1 environment variable. If you're using bash as your login shell, just do:

export PS1="$ "

and it will set your prompt to a plain $ character. If this results in something like "export: not found", you're probably using tcsh as your login shell, and you need to do:

set prompt = "$ "

If that doesn't work, I don't know. But, if the bash command works, you can create a .bashrc file in your home directory with that command and it will be run everytime you login. If you're using tcsh, make a .tcshrc file. (Note the '.' that starts those two files. These are hidden files in your home directory.)
     
Kvasir
Forum Regular
Join Date: May 2005
Status: Offline
Reply With Quote
May 27, 2005, 08:10 AM
 
Right, that's what I was getting at with my post above. In my .tcshrc I have the line

set prompt="%{\033[33;40m%}%d. %W/%D %n \n %/ -> %{\033[36;40m%} "

I get the same, custom prompt whether I connect via modem, wireless DSl at home, wireless or ethernet at work, etc, etc.
     
headbirth  (op)
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
May 27, 2005, 01:30 PM
 
Got it. Thanks
     
   
Thread Tools
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:44 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,