SSH connection issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SSH connection issue
# 1  
Old 08-29-2011
SSH connection issue

Hi Guys,

Asking your kind help to solve the issue

connecting to remote server via ssh
Purpose not to use password

Server A (Client) commands used

Code:
 
 mkdir -p $HOME/.ssh
chmod 0700 $HOME/.ssh
ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''

copied the public key in server B (Server)

Commands used

Code:
 
mkdir -p $HOME/.ssh
cat id_dsa.pub >> $HOME/.ssh/authorized_keys2
chmod 0600 $HOME/.ssh/authorized_keys2

Now used the below command for ssh

Code:
 
 ssh -o 'PasswordAuthentication yes' -o 'PreferredAuthentications publickey' -i $HOME/.ssh/id_dsa Server B

and found the below error

Code:
 
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive)

I dont have the rights to change in config file

Please suggest how can I login without using password
# 2  
Old 08-29-2011
Why did You use authorized_keys2 file on server side? Default sshd setting uses authorized_keys (without trailing "2"). Maybe that's the problem...
This User Gave Thanks to sulti For This Post:
# 3  
Old 08-29-2011
If both the server is not having the same user then you need to specify the user in the ssh command eg:- ssh <remote user>@serverb

run with -v option, it might help.

--ahamed
This User Gave Thanks to ahamed101 For This Post:
# 4  
Old 08-30-2011
Thanks a lot both of you...its working fine now

---------- Post updated at 11:33 PM ---------- Previous update was at 07:24 AM ----------

Can anyone kindly give me the equivalent code in perl.Thanks a lot
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

2. BSD

Connection SSH to remote by ssh

Hello guys! I am setting up a script to access a unix remote server. My problem is that when I put the ssh line "my host", the script does not wait for the server response asking for the password to execute the line in which I put the password, that is, I need to put a form in which script has a... (1 Reply)
Discussion started by: aroucasp
1 Replies

3. UNIX for Dummies Questions & Answers

Ssh refuse connection

I have 2 servers - x2200 and x4200 sun solaris i am having difficulty connecting between the 2 servers using ssh command even as they see each other using ping command. Find below the message i am getting :- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE... (4 Replies)
Discussion started by: abdull
4 Replies

4. UNIX for Advanced & Expert Users

Connection-less using ssh

Hi! I know its a recurring problem, but I am failing to sort this out, I have two servers ( A and B), in which I am able to connect without having to put password from server B to server A, but the connect from server A to server B. takes 7 minutes to establish??? on Server A, I have the... (7 Replies)
Discussion started by: fretagi
7 Replies

5. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

6. Red Hat

Ssh connection

hi, I have ssh connection between two servers for a functional Id for SFTP purpose. I aim is to setup this for is only work when below command is used by a .ksh script. ssh userid@servername:/directory Unfortunately users who have access to functional id are manually using above command... (2 Replies)
Discussion started by: maddy26615
2 Replies

7. Shell Programming and Scripting

ssh connection script

Hi all, I'm writing a script that chooses the best computer available in an open lab. The script works great except every now and then there is a dead computer in the lab that begins the ssh handshaking, but freezes after the following: debug1: Offering public key: When the script happens... (2 Replies)
Discussion started by: x-375HK-x
2 Replies

8. UNIX for Dummies Questions & Answers

ssh connection

Hi @ all! I've a problem with a ssh-connection. I want to establish a ssh-connection between an AIX-System and an SunOS-System without a password. The Users are different one's. Command : user1@server1 /home/user1 > ssh user2@server2 Is it possible? Greetings olli-h (1 Reply)
Discussion started by: olli-h
1 Replies

9. UNIX for Advanced & Expert Users

ssh connection

pls how do i connect to my freebsd server via ssh from a windows client?? I have sshd running on d freebsd server. (9 Replies)
Discussion started by: lealyz
9 Replies
Login or Register to Ask a Question