ssh: require passphrase from some servers but not others


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users ssh: require passphrase from some servers but not others
# 1  
Old 07-13-2009
ssh: require passphrase from some servers but not others

We have a number of linux clusters running Oracle. The clusters require that all member nodes have promptless/passwordless login through ssh (ie. the keys were created with null passphrases). We also have a management server that is not a member of any cluster but routinely connects to nodes of all clusters to perform maintenance activities, deploy scripts etc.

Currently, we have not added the management server's key to any of the authorized key files as unrestricted access to all cluster nodes is undesirable. Therefore, whenever the management node attempts to ssh into a cluster node, we are prompted for a password. Since some scripts make multiple secure calls to multiple nodes, we end up typing a lot of passwords...

I would like to enable some form of session-level passwordless login (through ssh-agent?), without removing promptless/passwordless login between nodes of a cluster and without granting unrestricted access to all nodes from the management server. Ideally, when executing a script that includes multiple secure calls to multiple nodes, we would only enter the password/passphrase once for each node.

Is this possible?
# 2  
Old 07-13-2009
Do you mean ssh access sometimes w/key and sometimes wo/key from the same account and node?

No. You cannot decide to turn/off/on passwordless key for some jobs and not others for one single account. Access is on a per user account basis, not per job.

You should consider creating protected key-only account(s), and grant only certain users sudo to that account(s). Which is akin to your idea of 'session-level'

You could also create one or more remote ssh-only account, example dummy, then give the keys to certain users and not others. Those with the key can go in with
Code:
ssh dummy@somenode

You can create different remote user accounts which are job specific, granting code access by chrooting each account and having links in /usr/bin (or wherever) that give access only to the code/scripts needed to run just that job.
# 3  
Old 07-13-2009
Well, I mean ssh access sometimes w/key and sometimes wo/key TO the same account and node.

The username on all nodes is the same ("oracle"). What I want is passwordless login from other nodes within the cluster but password login from any other server outside the cluster.

e.g.:
Code:
oracle@clusternode1# ssh clusternode2
   <no password>
oracle@someotherserver# ssh clusternode2
   <prompt for password>

I want oracle@clusternode2 to allow all other oracle@clusternode's passwordless login. oracle user's on all other servers must specify a password once per session.
# 4  
Old 07-14-2009
Take a look at ssh-agent. It's part of openssh. Here's info:

Manual Pages: ssh-agent(1)

I've never used it but I've read up on it a couple times. I'm pretty sure it'll give you exactly what you're looking for.

MG
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. UNIX for Beginners Questions & Answers

ssh multiple servers

Hi folks. I'm pretty new to unix, while I'm learning a lot I'm finding bash scripting quite confusing. Im sure it's not really, my head just hasn't clicked with it. Anyway, I need a script to loop the ip addresses stored in a file and run a "pgrep <process>" and return the pid or some... (2 Replies)
Discussion started by: MuntyScrunt
2 Replies

3. Shell Programming and Scripting

Supply passphrase for ssh in script

I would like to write a bash shell script which will connect to remote server using passphrase. (I have public-private infrastructure created, and as per instruction, I must not use password less ssh). This particular script will be fired from cron. Can you please advice how I can supply the... (2 Replies)
Discussion started by: atanubanerji
2 Replies

4. Solaris

How to disable/bypass passphrase prompt in ssh?

Hi Folks, I have setup a passwordless connection from my Linux ( source) machine toSolaris ( destination ) machine. I have added passphrase while creating the rsa key. Now problem is each time when i make a connection i have to give the passphrase to make connection. How to override this ? I... (4 Replies)
Discussion started by: chidori
4 Replies

5. Shell Programming and Scripting

Require single command to start script in multiple servers

I have 9 servers, on each server a script with common name is available. I send a token file to all server from 1 particular server. so when a daemon job checks that token file is available then it triggers the script.. I want to know is there any command or script which I will run/execute on... (16 Replies)
Discussion started by: mirwasim
16 Replies

6. OS X (Apple)

ssh passphrase issues - Mac OS X

ssh passphrase permissions issues I will try to be as thorough as possible, but keep in mind I am a designer, not a programmer... I do have linux mdadm experience and am reasonably comfortable behind the terminal, but I may need things to be spelled out for me. I am using 2 new-ish Macs with... (1 Reply)
Discussion started by: Ahab the Eskimo
1 Replies

7. Shell Programming and Scripting

automated ssh with provision for passphrase

Below is a part of my shell script. Currently I have shared the public key of the client with the host, therefore I will not be prompted for the password. The key that has been created on the client is also without a passphrase. If it is created with a passphrase, the code I have will not... (3 Replies)
Discussion started by: farahzaiba
3 Replies

8. Solaris

SSH passphrase and Password

Hello all, Today we run ssh with keys on all our Solaris systems. But I wounder: Is it possible to add another authentication too. Like the os/system regular password so the users first need to enter the ssh phasssphrase and after that they need to enter the os/system password. I need like... (3 Replies)
Discussion started by: jOOc
3 Replies

9. UNIX for Advanced & Expert Users

passphrase and ssh authentication

In which case could be better don't use a passphrase creating an authentication key for ssh comunications? Thanks in advance. (1 Reply)
Discussion started by: Minguccio75
1 Replies

10. UNIX for Advanced & Expert Users

ssh - at login Passphrase for key required

Hello, I want to use a shell-script to transfer data over sftp. I donīt find a way to login in automatically. I tried to send the password in a script like possible with ftp sftp user@server << cmd password cd /distant/directory lcd /local/directoryget ssh_install get ( or put) your... (2 Replies)
Discussion started by: olso
2 Replies
Login or Register to Ask a Question