LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2020, 04:23 AM   #1
Plankt0n
LQ Newbie
 
Registered: Mar 2020
Distribution: RHEL/CentOS
Posts: 5

Rep: Reputation: Disabled
RHEL7 - Set an alias/nickname for an IP to be access via firefox (without root)


I've duckduckgo'd for this but unable to find anything that can help me out.
The scenario is:

OS: 7.5 (Maipo)
Firefox 60.2.0esr

I have webservers setup that I can access by IP only since this is a test environment with no control over dns etc. The amount of servers are increasing and browsing to them by IP is starting to get tedious. What I want to do is to set an alias. Just like on windows where you can edit the hosts file to point an IP/fqdn to another source.

The tricky part is that I dont have root access on the jumpserver. Is this possible?

For instance being able to typ in http://backupserver in the browser and it gets re-directed to 132.196.1.2 etc.
 
Old 03-26-2020, 07:47 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,465

Rep: Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117
Quote:
Originally Posted by Plankt0n View Post
I've duckduckgo'd for this but unable to find anything that can help me out.
The scenario is:

OS: 7.5 (Maipo)
Firefox 60.2.0esr

I have webservers setup that I can access by IP only since this is a test environment with no control over dns etc. The amount of servers are increasing and browsing to them by IP is starting to get tedious. What I want to do is to set an alias. Just like on windows where you can edit the hosts file to point an IP/fqdn to another source.

The tricky part is that I dont have root access on the jumpserver. Is this possible? For instance being able to typ in http://backupserver in the browser and it gets re-directed to 132.196.1.2 etc.
Yes, you can add the IP addresses to your /etc/hosts file so that "backupserver" points to 132.196.1.2. Same for any other servers.
 
Old 03-26-2020, 09:11 AM   #3
Plankt0n
LQ Newbie
 
Registered: Mar 2020
Distribution: RHEL/CentOS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Yes, you can add the IP addresses to your /etc/hosts file so that "backupserver" points to 132.196.1.2. Same for any other servers.
Quote:
Originally Posted by Plankt0n View Post
The tricky part is that I dont have root access on the jumpserver. Is this possible?
https://i.ibb.co/Cv1JNxH/Screenshot-...6-15-08-04.png
 
Old 03-26-2020, 09:22 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,465

Rep: Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117
Quote:
Originally Posted by Plankt0n View Post
Right; you don't change the 'jump server'...you change YOUR LOCAL MACHINE, which you should have access to. That's why I said "your /etc/hosts file". If you can't change things on your local machine, then you need to talk to whoever DOES have access, and have them do it.

The tiny screen-shot you posted doesn't say whether or not you ran "sudo vi /etc/hosts" or whether you tried it as your 'regular' user. You need root/sudo access to change that file, bringing us back to the question of your local access.

Last edited by TB0ne; 03-26-2020 at 09:23 AM.
 
Old 03-26-2020, 09:33 AM   #5
Plankt0n
LQ Newbie
 
Registered: Mar 2020
Distribution: RHEL/CentOS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Right; you don't change the 'jump server'...you change YOUR LOCAL MACHINE, which you should have access to. That's why I said "your /etc/hosts file". If you can't change things on your local machine, then you need to talk to whoever DOES have access, and have them do it.

The tiny screen-shot you posted doesn't say whether or not you ran "sudo vi /etc/hosts" or whether you tried it as your 'regular' user. You need root/sudo access to change that file, bringing us back to the question of your local access.
If I don't have root access I assumed people understood that my normal user isn't in the sudoers file, my bad. And it's the Jumpserver that I want to have the change done at, since well. It's from where I browse to the IPs. But after some further reading on the net this kind of thing seems like choir. And I will simply have to live with it.

Can consider this question closed.
 
Old 03-26-2020, 09:33 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,037

Rep: Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284
If you don't have root access to change /etc/hosts you can try this:

Create a file in your home folder called myhosts
In the file add hosts in this format (yes, it does look the wrong way around and the .xip.io is important!)
Code:
backupserver 132.196.1.2.xip.io
In your shell use
Code:
export HOSTALIASES=~/myhosts
Try http://backupserver in your browser.

Edit: Note, you won't be able to [b]ping backupserver[/p] but give it a try with a browser and see how you get on. I tried it on Centos 7.7 and it worked, but may depend on how your server is configured.

Last edited by TenTenths; 03-26-2020 at 09:36 AM.
 
Old 03-26-2020, 09:47 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,465

Rep: Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117Reputation: 6117
Quote:
Originally Posted by Plankt0n View Post
If I don't have root access I assumed people understood that my normal user isn't in the sudoers file, my bad. And it's the Jumpserver that I want to have the change done at, since well. It's from where I browse to the IPs. But after some further reading on the net this kind of thing seems like choir. And I will simply have to live with it.

Can consider this question closed.
And based on what you posted, it was understood that you had a WORKSTATION that hit a JUMP-SERVER to access those IP's, not that you were working directly on the jump server. Given scenario one, you change your workstation hosts file. If you have to change the jump server and you have no access to it, you obviously won't be able to. The solution TenTenths suggested may also work, but instead of posting back to someone with their own suggestion and a tiny screen-shot, you may want to consider actually explaining further, since there was obviously a miscommunication.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Attempting RHEL7.6 and connecting via ssh -X, VNC, RDP...from rhel7/6 or fedora30 aalinare Linux - Server 3 10-10-2019 05:02 PM
Unable to install RHEL7 KVM onto RHEL7 desktop redhatprat Red Hat 10 02-18-2015 03:44 AM
Error for wireless request "Set Nickname" (8B1C) -- /etc/rc.d/rc.inet1.conf hellbillyJoker Linux - Networking 1 04-06-2010 07:24 PM
Error for wireless request "Set Nickname" robogymnast Linux - Wireless Networking 5 09-23-2008 07:26 AM
Wireless autoconnect (error for wireless request "set Nickname" (8B1C)) hellasyoda Slackware 7 05-19-2008 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration