|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I need to sftp from one Unix Server (source) to another (destination) (both SunOS) non-interactively. I did the following : 1) Generated public key in source server in $HOME/.ssh dir without giving any passphrase 2) Added the contents of the public key generated to authorized_keys2 file in destination server's $HOME/.ssh directory 3) Permissions for the .ssh dir's is 0700 and the key files is 0600 4) Created a file named "confg" in source $HOME/.ssh dir which has the below contents. Host * BatchMode yes PasswordAuthentication no Still its asking me for a password (not passphrase) when I give sftp destinationuserid@destinationservername in client When I give the password, its getting connected. But I want non-interactive login where the sftp command should not be prompting me for any password ? Please help me what I need to do here or if I am doing anything wrong here ? Thanks, Sabari Nath S Last edited by Sabari Nath S; 03-11-2010 at 04:46 PM.. |
| Sponsored Links | |
|
|
|
#2
|
|||
|
|||
|
The home directory of the remote account has to be 755. For starters. And the key file gets named authorized_keys. If there are more than one key file just use Code:
cat keyfile1 keyfile2 ... keyfilen > authorized_keys If that doesn't help post the output of Code:
ssh -vvv remotebox |
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
Also the permissions on the .ssh subdirectory should be set to 700 and the permissions of every file in the .ssh subdirectory should be 600.
|
|
#4
|
|||
|
|||
|
Hi, I had already changed the permissions for all files under .ssh to 600 and the .ssh dir to 700 Client: Code:
$ ls -ld .ssh drwx------ 2 cdbcdi other 512 Mar 12 00:04 .ssh $ cd .ssh $ ls -l -rw------- 1 cdbcdi other 47 Mar 11 14:42 config -rw------- 1 cdbcdi other 883 Mar 11 12:48 id_rsa -rw------- 1 cdbcdi other 332 Mar 11 12:49 id_rsa.pub $ cat config Host * BatchMode yes PasswordAuthentication no Server (Host): Code:
$ ls -ld b2cint (Home Directory) drwxr-xr-x 3 b2cint custapp 512 Mar 11 11:05 b2cint $ cd b2cint/.ssh $ ls -ld ../.ssh drwx------ 2 b2cint custapp 512 Mar 11 14:39 ../.ssh $ ls -l -rw------- 1 b2cint custapp 332 Mar 11 14:39 authorized_keys -rw------- 1 b2cint custapp 332 Mar 11 14:38 authorized_keys2 But still it asks for a password. Last edited by pludi; 03-12-2010 at 04:33 AM.. Reason: code tags, please... |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
The source needs to have the id_rsa.pub key of the user that will be sending the file copied to the destination server user's home/.ssh/authorized_keys or authorized_keys2
|
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
It already has. I have already placed the contents of id_rsa.pub to authorized_keys2 file under $HOME/.ssh dir in the host.
|
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
authorized_keys2 has been depreciated for 8 years now. Just cat all of them together into authorized_keys.
|
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to write script that behaves both in interactive and non interactive mode | rits | Homework & Coursework Questions | 8 | 08-17-2009 11:47 PM |
| Help with Interactive / Non Interactive Shell script | rits | Homework & Coursework Questions | 1 | 08-16-2009 04:39 PM |
| SFTP - non-interactive - using passphrase | sandy0077 | Shell Programming and Scripting | 1 | 10-11-2008 01:18 PM |
| SFTP Failed---Request for subsystem 'sftp' failed on channel 0 | mahiban | AIX | 0 | 07-25-2008 02:51 AM |
| SFTP- Non-interactive user authentication | dheeruchakri | Shell Programming and Scripting | 1 | 03-10-2006 11:14 AM |
|
|