LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-02-2009, 08:26 AM   #1
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 302
Blog Entries: 4

Rep: Reputation: Disabled
Bash Environment Roaming Profile?


Hi all. Supposing I wanted the same bash profile environment regardless of which server I ssh into. Would it be possible to somehow pull a set of files from one [supposing we called it] "template" server (that has the set of files used regularly, containing my .bash_profile and other . files) onto each server automatically? All of these servers have my ssh key and I have an alias setup (on my Macbook Pro) to connect using a number, i.e. typing "1" connects me to server1.domain and so forth. They're passwordless key pairs because we're pretty confident our hardware firewall perimeter is solid. To take this a step further, for those servers I missed (scp'ing the ssh keys to in other words), would it be possible to automatically grab the necessary authorized_keys contents to them without prompting me for a password?
 
Old 12-02-2009, 09:53 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
You could simply scp the .bash* files ahead of your ssh connection for the first part of the question. The later part could be accomplished using a variety of methods none of them what I would consider safe in the long run because they end up storing a password in an unencrypted file.
 
Old 12-04-2009, 12:24 PM   #3
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 302

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
Alright. I was afraid of that. Thanks for reviewing it anyway.

Loadedmind
 
Old 12-04-2009, 01:05 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look in the ssh_config and sshd_config man pages. `SendEnv' in ssh_config on the client defines which environmental variables to send to the server when you log in. `AcceptEnv' in sshd_config defines which variables to accept. Pay attention to the warning about doing this in the man pages.
 
Old 12-04-2009, 03:41 PM   #5
stevenworr
LQ Newbie
 
Registered: Oct 2008
Posts: 13

Rep: Reputation: 1
I think your question is flawed. You need to be more explicit about what you mean by environment, if you think the environment means more than the set of environment variables you define. I personally set all my environment variables in a way that allows each machine to be customized. It sort of helps that lats of env vars are all managed as colon separated lists. I use that fact to create flat files which are read by a common script to form the different values for each of the variables. Each flat file can be designed to be common across lots of machines with varying architectures. In the end, the values of the variables are stored on a basis that allows for slicing and dicing any way you like and only the data files are needed but the scripts are common.
 
Old 01-13-2010, 12:36 PM   #6
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 302

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
stevenworr:
Is it possible for you to provide the env variables/files involved as an example and just mask the private info within them?

jschiwal:
Thank you for that information. I guess I hadn't realized ssh_config had that kind of power. I'll definitely check into it.

Thanks all!
 
  


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
roaming profile on samba.. cruzler Mandriva 0 10-26-2008 10:46 PM
how to set environment variables in bash profile praveenkorukonda Linux - Newbie 1 02-21-2007 11:40 PM
samba roaming profile sahu_mahen Linux - Networking 0 07-13-2006 10:20 AM
non roaming profile on a roaming profile system fieldyweb Linux - Newbie 1 10-03-2005 12:27 PM
Roaming profile permissions.. Ateo Linux - Networking 3 12-24-2004 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:09 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
Open Source Consulting | Domain Registration