Is it possible to display a different hostname, when a user logs in?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have an issue where my customer used a different hostname naming convention than my company did, for the devices they purchased from us. Example:
We named the devices Lenny1, so the FQDN is lenny1.whatever.com and user@Lenny1 is what is visible to users when they log in to the device.
The customer used the name PCAP02 for this same device. This creates confusion for users when they log in and see Lenny1 as the system name.
For very complex reasons, we cannot easily change the /etc/hosts file to use the names that our customer uses. My question is, is there a way to spoof the system name that the customer will see, when they log in? This change needs to be purely cosmetic, so that the users won't get confused about what system they're logging in to.
rhel hostname
add a comment |Â
up vote
1
down vote
favorite
I have an issue where my customer used a different hostname naming convention than my company did, for the devices they purchased from us. Example:
We named the devices Lenny1, so the FQDN is lenny1.whatever.com and user@Lenny1 is what is visible to users when they log in to the device.
The customer used the name PCAP02 for this same device. This creates confusion for users when they log in and see Lenny1 as the system name.
For very complex reasons, we cannot easily change the /etc/hosts file to use the names that our customer uses. My question is, is there a way to spoof the system name that the customer will see, when they log in? This change needs to be purely cosmetic, so that the users won't get confused about what system they're logging in to.
rhel hostname
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have an issue where my customer used a different hostname naming convention than my company did, for the devices they purchased from us. Example:
We named the devices Lenny1, so the FQDN is lenny1.whatever.com and user@Lenny1 is what is visible to users when they log in to the device.
The customer used the name PCAP02 for this same device. This creates confusion for users when they log in and see Lenny1 as the system name.
For very complex reasons, we cannot easily change the /etc/hosts file to use the names that our customer uses. My question is, is there a way to spoof the system name that the customer will see, when they log in? This change needs to be purely cosmetic, so that the users won't get confused about what system they're logging in to.
rhel hostname
I have an issue where my customer used a different hostname naming convention than my company did, for the devices they purchased from us. Example:
We named the devices Lenny1, so the FQDN is lenny1.whatever.com and user@Lenny1 is what is visible to users when they log in to the device.
The customer used the name PCAP02 for this same device. This creates confusion for users when they log in and see Lenny1 as the system name.
For very complex reasons, we cannot easily change the /etc/hosts file to use the names that our customer uses. My question is, is there a way to spoof the system name that the customer will see, when they log in? This change needs to be purely cosmetic, so that the users won't get confused about what system they're logging in to.
rhel hostname
edited Apr 12 at 15:12
0xC0000022L
7,0831359105
7,0831359105
asked Apr 12 at 1:29
GreNIX
527
527
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
You can change that in the /etc/bashrc file.
Please make a backup of this file in case you make any mistakes.
Within the file, you will see this line:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ "
h is the hostname of the machine. Remove that and replace it with PCAP02.
That line should then look like this:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@PCAP02 W]\$ "
Save the file and enter bash and you will see user@PCAP02 in the terminal. Your customers will see the change when they SSH into the machines.
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
You can change that in the /etc/bashrc file.
Please make a backup of this file in case you make any mistakes.
Within the file, you will see this line:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ "
h is the hostname of the machine. Remove that and replace it with PCAP02.
That line should then look like this:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@PCAP02 W]\$ "
Save the file and enter bash and you will see user@PCAP02 in the terminal. Your customers will see the change when they SSH into the machines.
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
add a comment |Â
up vote
4
down vote
accepted
You can change that in the /etc/bashrc file.
Please make a backup of this file in case you make any mistakes.
Within the file, you will see this line:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ "
h is the hostname of the machine. Remove that and replace it with PCAP02.
That line should then look like this:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@PCAP02 W]\$ "
Save the file and enter bash and you will see user@PCAP02 in the terminal. Your customers will see the change when they SSH into the machines.
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
You can change that in the /etc/bashrc file.
Please make a backup of this file in case you make any mistakes.
Within the file, you will see this line:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ "
h is the hostname of the machine. Remove that and replace it with PCAP02.
That line should then look like this:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@PCAP02 W]\$ "
Save the file and enter bash and you will see user@PCAP02 in the terminal. Your customers will see the change when they SSH into the machines.
You can change that in the /etc/bashrc file.
Please make a backup of this file in case you make any mistakes.
Within the file, you will see this line:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ "
h is the hostname of the machine. Remove that and replace it with PCAP02.
That line should then look like this:
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@PCAP02 W]\$ "
Save the file and enter bash and you will see user@PCAP02 in the terminal. Your customers will see the change when they SSH into the machines.
edited Apr 12 at 15:03
answered Apr 12 at 2:19
Nasir Riley
1,514138
1,514138
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
add a comment |Â
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
You are welcome. Glad to help.
â Nasir Riley
Apr 12 at 15:05
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437173%2fis-it-possible-to-display-a-different-hostname-when-a-user-logs-in%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password