LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH and scripting (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-and-scripting-119420/)

JeRrYmAn 11-24-2003 06:39 AM

SSH and scripting
 
I need a little help with ssh-agent and a simple script:

code:
___________________________________________
eval 'ssh-agent $SHELL'
ssh-add
sftp -b batch user@server
eval 'ssh-agent $SHELL -k'
---------------------------------------------------------------------

It works but gives the output:

bash-2.05$ exit (i then enter 'exit')
exit
Need passphrase for /home/user/.ssh/identity
Enter passphrase for /home/user/.ssh/identity
Identity added: /home/user/.ssh/identity (/home/user/.ssh/identity)
bash-2.05$ exit(entered exit again)
exit


how do i script the batch so that i don't have to enter exit.

david_ross 11-24-2003 03:02 PM

Try putting "exit" in a line at the end of your code.

JeRrYmAn 11-25-2003 03:34 AM

oK CEWL, where do i script to create a costom login message for the current user

sopiaz57 11-25-2003 09:04 AM

you can do that in two ways, 1 there is the /etc/motd file and 2 there is a directive in sshd_config called banner, where you point to a file containing a welcome banner or something.

david_ross 11-25-2003 12:34 PM

If it is different messages then you can edit /etc/basrc and get it to display an individual message per user too.


All times are GMT -5. The time now is 08:18 PM.