Ssh log-in

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Ssh log-in
# 1  
Old 11-08-2013
Ssh log-in

Hi all,

I was trying to do password less ssh log-in between two machines with different host name( linux & redhat), and I used the following commands:

Code:
ssh-keygen –t rsa

scp /root/.ssh/id_rsa.pub redhat:/root/.ssh/authorized_keys

Code:
ssh-keygen –t rsa

scp /root/.ssh/id_rsa.pub linux:/root/.ssh/authorized_keys

I am able to log-in from linux to redhat but not able to log-in from redhat to linux without password.

please suggest where I am lacking.......Smilie

Last edited by Scott; 11-08-2013 at 01:20 PM.. Reason: Please use code tags
# 2  
Old 11-10-2013
Hello,

Does it DNS is resolving?
Print output your "nslookup".
# 3  
Old 11-10-2013
Perhaps the ssh server and/or ssh client configurations are different on the servers?
# 4  
Old 11-10-2013
We could be here all day trying at guessing. Best way of troubleshooting is to obtain data looking at the logs.

First ssh using the -v option: this will output the verbose process of login
Other places to obtain data are in /var/log. This is OS dependent. /var/log/auth, /var/log/secure* /var/log/audit/audit.log*, /var/log/messages are possible candidates for login information.


Common causes for ssh errors with key are:
Wrong permissions for ~/.ssh directory. It should be 700
Wrong ownership or permissions for ~/.ssh/authorized_keys. Depending if you are using an old version of openssh this file could be called authorized_keys2
It should have permission to write only to owner and not executable to anyone.
# 5  
Old 11-11-2013
Hi Team,

Thanks for the support. But,I guess there was some mistake from my side in executing the commands as I got the desired output when I again performed the task.
Output:
-------------------------------------
Code:
[root@linux ~]# ssh redhat
Enter passphrase for key '/root/.ssh/id_rsa':
Last login: Thu Nov  7 07:06:40 2013 from linux.testlab.org
[root@redhat ~]#

-------------------------------------
-------------------------------------
Code:
[root@redhat ~]# ssh linux
Enter passphrase for key '/root/.ssh/id_rsa':
Last login: Thu Nov  7 23:36:19 2013 from redhat.testlab.org
[root@linux ~]#

-------------------------------------

Last edited by Franklin52; 11-11-2013 at 05:43 AM.. Reason: Please use code tags
# 6  
Old 11-14-2013
I don't see that your using an ssh agent. Example below.
Code:
bitlord@linux> eval `ssh-agent`
bitlord@linux> ssh-add
Enter passphrase for /home/bitlord/.ssh/id_rsa: 
Identity added: /home/vivek/.ssh/id_dsa (/home/bitlord/.ssh/id_rsa)

Why are you useing root to login to anther server? Many Servers don't allow this. Try using a normal user account to do this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems in analysing SSH LOG users & time

Attached is the log file that I have generated through the following script: last | head -2 |sed '2q;d' |awk '{ print $1"\t"$2"\t"$3"\t\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t" $9"\t"$10"\t"$11}'>>/var/log/logadmin/logtest.txt But now I'm unable to run the following operations on it: 1. Count... (1 Reply)
Discussion started by: Lionking93
1 Replies

2. Shell Programming and Scripting

Log Out SSH User in Bash

So, I've been writing a system to allow users temporary access onto a system. Essentially, there's a web server with a PHP script, the PHP script takes a Username & Password from a webform, and passes it to a script, createusr.sh. The script looks something like this: pass=$(perl -e 'print... (2 Replies)
Discussion started by: FreddoT
2 Replies

3. Cybersecurity

Log remote execution over SSH

If a user execute commands remotely over ssh : $ ssh USERNAME@SERVER COMMANDSHow the SERVER administrator can log those COMMANDS executed in a "not a tty" session ? I searched for my question and get the following suggestions:Anybody give help how to do this ? what the content of "/bin/bash "... (1 Reply)
Discussion started by: new0h
1 Replies

4. Solaris

Can't SSH log in without password.

I am working on Solaris 10 Sparc. While ssh trust relation building for SUN-CLUSTER on server, I am facing issue. I can log in from server2 to serer1 direactly but when i log in to server1 from server2 it prompts password. root@app1 # ssh app2 Last login: Wed Jul 27 14:08:14 2011... (0 Replies)
Discussion started by: anand87
0 Replies

5. Shell Programming and Scripting

Logging Remote SSH command (cannot log a java output)

Hi all I'm creating a script that runs a few commands on some boxes and everything can be logged EXCEPT the java -version command, there doesn't seem to be any output... Can anyone help explain why this does not work? Do I need to do something extra to append the output from the java... (3 Replies)
Discussion started by: Keepcase
3 Replies

6. Solaris

Global zones - not allow log via SSH

Hi, I have Global zone and 2 users: root and app. I know password root and app. When a user app log - putty displays Access denied Using keyboard-interactive authentication. In file /etc/security/policy.conf I set CRYPT_DEFAULT=2a And in file /etc/ssh/sshd_config I set PermitRootLogin... (1 Reply)
Discussion started by: bieszczaders
1 Replies

7. Shell Programming and Scripting

Create log file in NFS via SSH

OS: Sun Solaris ver 9 From server1: as root userid ssh server2 /export/home/user1/.ssh/s2.sh logtest=/export/home/user1/test.log log1=/u03/user2/comn/admin/log/ uname -a >> $logtest --> log file able to generate uname -a >> $log1 --> not able to as /u03/user2/comn/admin/log is NFS from... (3 Replies)
Discussion started by: KhawHL
3 Replies

8. Solaris

log into windows from unix using ssh

Hi, I want to log into windows from unix using ssh through a script to execute some commands.We have cygwin installed on windows.We have expect library installed on unix(sun solaris).What would be codes for logging into widows from a shell script. Regards, Megh (1 Reply)
Discussion started by: megh
1 Replies

9. Shell Programming and Scripting

Append log file through ssh

Hello.... I am attempting to append a master log file with the contents of log files that are contained on about 7 servers. #!/bin/sh > /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG ###################################################################### # Server Delphin / OS: Solaris... (1 Reply)
Discussion started by: LRoberts
1 Replies

10. Shell Programming and Scripting

SSH/Sftp log in fail recovery

I am connecting to X number of boxes and using sftp to grab files that need to backed up. the box i am doing it from should have keys set up, but in case something happens and it doesnt i need my script to recover from it and not sit there waiting for a password for 10 min. And i need to log which... (0 Replies)
Discussion started by: rcunn87
0 Replies
Login or Register to Ask a Question