LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2009, 01:45 AM   #1
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Rep: Reputation: 32
Hostname aliases at user level


The scenario is that an administrator creates hostnames that are lengthy and unpronouncable. How can users workaround this? Apparently the users ~/.rhosts file cannot be used to create aliases.

The best option I can think of is environment variables. Eg. export scooby='jaoiwja234'. What I don't like is having to type a $ sign every time I reference it.
 
Old 02-03-2009, 10:41 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Are DNS CNAME recs an option? This is not at the user level, but it may solve the problem.

e.g.
Code:
%host easy.your.domain
easy.your.domain is an alias for sfdhsdf3424234.your.domain.

Last edited by anomie; 02-03-2009 at 10:43 AM.
 
Old 02-03-2009, 02:39 PM   #3
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
The problem is that the admins are not interested in user friendly hostnames, and do not intend to cooperate. So the mission is to create user friendly names with user priviledges. I know if there were admin support, there would probably be a dozen reasonable ways to do this.

It's a shame that the ~/.rhosts file cannot be used for this purpose.
 
Old 02-03-2009, 02:55 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
My next suggestion, then, is adding /etc/hosts entries for each user. That is going to be a big hassle with lots of users.

e.g.
Code:
%grep easy /etc/hosts
# The following 'easy' entry is used to resolve
# 'easy' to sfdhsdf3424234.your.domain's IP. 
10.5.5.5         easy.local       easy
There may be a more elegant way to map a friendly name to an unfriendly (DNS rec in your case) name, but I'm not sure I know what that is.
 
Old 02-04-2009, 12:21 AM   #5
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by anomie View Post
My next suggestion, then, is adding /etc/hosts entries for each user. That is going to be a big hassle with lots of users.
That requires admin rights, so it's not an option.
 
Old 02-04-2009, 12:51 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I don't think I need to tell you this, but the customer support relationship seems to be badly broken in your situation. If there is a strange technical requirement (i.e. long, bizarre hostnames) that is preventing users from doing their jobs, there should be appropriate remediation -- not some user-level hack job.

---

Anyway, another technical suggestion to fix this organizational problem: Give some more details about the services the users need to access. There may be application-level ways to work around the problem.

For shell users who ssh to a few different servers, for example, you could set up a script and alias to it.

Code:
$ cat ~/.my-scripts/ssh-resolver.sh 
#!/bin/sh

case "${1}" in

  'host1'  ) exec ssh sfdhsdf3424234.your.domain ;;
  'host2'  ) exec ssh xxbbxdf3424234.your.domain ;;
  'host3'  ) exec ssh yyyzzaf3424234.your.domain ;;
  *        ) echo "Usage: ${0} host[n]" ; exit 1 ;;

esac

exit 0
Code:
$ alias ssh='~/.my-scripts/ssh-resolver.sh'
 
  


Reply



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
accessing SPI from kernel level and user level ramya_ts Programming 1 01-06-2009 07:30 AM
User aliases markymarkp Linux - Newbie 1 09-02-2008 07:15 PM
[SOLVED] create command aliases for a user vikas027 Solaris / OpenSolaris 3 05-18-2008 04:26 AM
Samba or Wins issue: netbios aliases, not accessible by hostname pingu Linux - Networking 1 05-02-2008 01:51 PM
Postfix unable to deliver mail because user@virtualdomain becomes user@hostname azrael808 Linux - Networking 0 04-29-2006 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:31 AM.

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
Open Source Consulting | Domain Registration