sftp using authorized_keys in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp using authorized_keys in unix
# 1  
Old 03-24-2008
sftp using authorized_keys in unix

I am creating public and private key for sftp in ksh.

then copy the name1.pub file into /.ssh/authorized_keys directory in remote server.

Now my question is how to write that script which do not ask me for the password from prompt.

please help.

thanks in advance.
# 2  
Old 03-24-2008
I'm not exactly sure of the question. The whole point of using keys with ssh is so that you do not have to provide a password. If this is not setup correctly then you will be prompted for a password.

If you try "ssh <remote-host> hostname" are you prompted for a password? If so doublecheck that you have your keys installed correctly. Also check your permissions. The keys will not work if your directory tree is world readable.

If the ssh command works with no password then you are setup correctly. Next, to run in a script try the scp command to move files back and forth. (man scp)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Help me to revert the file /root/.ssh/authorized_keys

Hi, I copied the key of rsa.pub to authorized_keys using the below command cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys By mistake i have executed another command view cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys so now additional keys are copied.so please help me... (3 Replies)
Discussion started by: SA_Palani
3 Replies

2. Shell Programming and Scripting

Appending authorized_keys on multiple servers using ssh

Hi I have an ssh 'for' loop script to login and put a key on multiple servers. I need to append a file on each server but the command which works ok from the prompt does not work via the script. I have cat filename | ssh user@servername "cat >>append.file.name" I have tried to 'spawn' this in... (0 Replies)
Discussion started by: Grueben
0 Replies

3. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

4. Red Hat

Choosing best location for authorized_keys!

Hello Friends, I am trying to troubleshoot one scenario for the customer. In their server configuration, each vhost has it's own user. The option is to shell access chrooted. The question is where would be the best place to store the authorized_keys file so that we can ssh in from the... (0 Replies)
Discussion started by: user3528
0 Replies

5. Shell Programming and Scripting

SSH w/ command in authorized_keys apparently needs pty

I'm trying to have an unattended remote PC log some data on home PC. man sshd says I should be able to put a command in authorized_keys. This is what I have on the remote machine. The key is a special key that isn't used elsewhere. In my ~/.ssh/authorized_keys file on my desktop:... (12 Replies)
Discussion started by: KenJackson
12 Replies

6. UNIX for Advanced & Expert Users

Centrilized authorized_keys (AuthorizedKeysFile) for sshd

Hi Little background on what I want to achieve and why I do this. I have a RHEL server with users logging in via ssh. I want to start using public keys instead of passwords with ssh. But public key is as good as a rotten tomato if it is unpassphrased and I cannot guarantee that all users will... (4 Replies)
Discussion started by: bortek
4 Replies

7. Red Hat

authorized_keys and passwordless login

I am trying to set up ssh/scp to be able to login in w/o using a password. The man pages for ssh and ssh-keygen explain how to do this. So, using "rsa1" style, I created the public and private keys by way of ssh-keygen, then added the contents of "$HOME/.ssh/identity.pub" to a newly created... (6 Replies)
Discussion started by: mcrouch_2003
6 Replies

8. Solaris

Will Password change affect authorized_keys?

Hello gurus, I have question. I have enabled ssh on the servers. I am planning to change the oracle user's(os user) password. If I change the password will it affect the authorized_keys? Do I need to regenerate it. Thanks, (2 Replies)
Discussion started by: oracleuser
2 Replies

9. UNIX for Advanced & Expert Users

monitoring SSH authorized_keys

Hi, We have around 200 SUN Servers in production environment and I have one box from where I manage all the servers. It's setup such that I can SSH from my box onto all the 200 servers with without supplying password. It is working fine but sometimes we notice the keys getting changed and asking... (1 Reply)
Discussion started by: prvnrk
1 Replies

10. Shell Programming and Scripting

monitoring SSH authorized_keys

Hi, We have around 200 SUN Servers in production environment and I have one box from where I manage all the servers. It's setup such that I can SSH from my box onto all the 200 servers with without supplying password. It is working fine but sometimes we notice the keys getting changed and asking... (0 Replies)
Discussion started by: prvnrk
0 Replies
Login or Register to Ask a Question