2

I was using the terminal to verify some downloads today using SHA1/256 and my terminal prefix has changed to

inside-167-7:~ [_name_]$

Previously, it contained system info. I have no idea what the inside-167 is supposed to mean, can anyone clarify or tell me how to revert back?

I’ve tried listing processes and tried any “stop current programs in terminal” but to no avail.

I have also tried customizing my profile thru nano .bash_profile but what bothers me is that I feel like my Terminal is running a program rather than the visual aspect of the terminal itself. Functions like ls still work and list folders, when I exit and restart the terminal, I still start with the same prompt

1
  • What does echo $PS1 show? Also, is there anything that changed in your ~/.bashrc or ~/.profile that you know of? What specifically were you doing in your terminal when the change occurred? If it persists in new terminal windows, something may have changed those files. Commented Dec 14, 2015 at 18:24

2 Answers 2

3

You say this:

Previously, it contained system info. I have no idea what the inside 167 is supposed to mean, can anyone clarify or tell me how to revert back?

Don’t panic!

You mentioned using doing some SHA1/256 stuff, but I don’t think this is related to the prompt changing in any way. My guess is that you have connected to a new network—perhaps not your home but a campus network or such—and the reverse DNS is being used by Mac OS X to set the machine name on the command prompt to be the hostname assigned via DHCP and not your local system name.

Meaning that your Mac OS X machine should be showing whatever your local machine name is; for example—using your username as a hostname—you might have a machine name such as myTotoro.local. But then when you connect to a network that assigns a hostname via DHCP that changes the hostname. This is normal behavior for Mac OS X but can be quite confusing.

This guess comes from the fact the inside-167-7 parses like some DHCP address assigned to something like free Wi-Fi. Something that would translate to—wild guess—but an “inside” Wi-Fi connection on router designated 167-7 or the 7th user on router 167 or something like that. The naming schemes of some setups are weird and I have seen odder hostnames set when jumping from network to network.

How to change the hostname in Mac OS X which is connected to the prompt value.

Anyway, assuming that is the case you can force your Mac OS X setup to always use your local hostname by using this command:

sudo scutil --set HostName [insert your desired hostname here]

For example—using your username as a hostname—you might want to set it like this:

sudo scutil --set HostName myTotoro.local

Then just close the Terminal and open a new Terminal and you should be good to go.

I doubt any of this is malware or some malicious software.

I doubt any of this behavior is malicious or you are somehow seeing some bizarre “man in the middle” attack where your Terminal is being proxied through some malicious software. I mean the concept of a TTY session being hijacked is nothing new, but it’s really not a viable threat nowadays unless the attacker knows for sure you are using the Terminal since most users just use the Mac OS X GUI (aka: the Finder) nowadays anyway. And from my experience what you describe just seems like DHCP hostname silliness.

1
  • Wow, I'm amazed you were able to infer that ! :) It is exactly as you described, though I didn't know that doing SHA1/256 checks required me to connect to a new network - is this normal behaviour? I've set the new host names and it's working
    – myTotoro
    Commented Dec 14, 2015 at 18:37
-1

For BASH and CSH, the prompt is controlled via the PS1 environment variable. To find out what is in it currently, type echo $PS1 in the shell. To change it from the shell, type export PS1=<formatString> with the formatString you desire. If you wish to customize it, it's a good idea to put an set PS1=<formatString> in your ~/.bashrc or possibly even in your ~/.profile. There are plenty of resources online with examples of how to do this.

If using TCSH, the appropriate variable is prompt rather than PS1. To find out what shell you're using, do echo $SHELL.

Disclaimer: I don't own any Macs.

2
  • Yeah, not quite what I was looking for but very similar, the visual appearance of the terminal didn't bother me - see edit above
    – myTotoro
    Commented Dec 14, 2015 at 18:17
  • That's interesting that you already did this and restarting the shell doesn't fix things. Either way, I think the issue is clear: something is setting your PS1 var. So, while it may be difficult to pin down, you'll have to start grepping files to find where the PS1 var is being set. What does the echo $PS1 say? What changed recently? Start with those programs/files. FWIW, I'm just getting started, so my rep is not yet high enough to comment on questions. I tried to provide an answer, which I think is correct, to the best of my ability: basically you need to debug why your PS1 is changing.
    – tniles
    Commented Dec 14, 2015 at 18:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .