Sponsored Content
Top Forums Shell Programming and Scripting using SSH with my script and avoid logging in manually Post 302356147 by ramangill on Thursday 24th of September 2009 04:50:58 PM
Old 09-24-2009
using SSH with my script and avoid logging in manually

Hi Guys.

I have 3 variables
$HOST
$Username
$Password

I want to connect to a remote server using SFTP.

Code:
usr/bin/sftp -o Cipher=blowfish $Host

Where do I put in the options for the username and pwd??? I have tried different ways and nothing works. It keeps coming back and promting me.

a piece from my script
Code:
usr/bin/sftp -o Cipher=blowfish $HOST  <<SFTP_END
user $UserName $Password
SFTP_END

What I get in return
Code:
Connecting to mlisgcadev4...
user@host's password:

There should be a way where I can pass in all 3 values and be on my way no???
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH and command logging

Hi all... I've completed the task of deploying SSH over my 400 servers. I don't know if i'm right or wrong, but ssh doesn't do any command-logging, does it? Is there a app i can use to log all commands passed ( besides the usual .sh_history), whith no modification possible by the user, and how... (2 Replies)
Discussion started by: penguin-friend
2 Replies

2. OS X (Apple)

SSH Logging?

Does anybody know if MacOS X (10.3.X) is capable of logging ssh access? I want to be able to see who has logged into my system via SSH, similar to the way Apache or FTP logs access (/private/var/logs/). The only thing that I am finding right now is the the initiation of a PID in the "system.log",... (0 Replies)
Discussion started by: esser
0 Replies

3. UNIX for Advanced & Expert Users

What change in freeBSD OS to allow root logging using ssh?

Hi everybody, ] I would like to ask just simpe and short question. I am using freeBSD 6.0 and Debian Sarge. From Debian console I can log as root using ssh to bsd mashine but not vice versa. When I say in bsd console su I got sorry output, it does not allow me to su to root when I am logged... (5 Replies)
Discussion started by: 100days
5 Replies

4. UNIX for Advanced & Expert Users

ssh not logging users

We installed ssh on our AIX 5.3 box. The issue we are facing is that we dont get the users listed when we use 'w' or 'who'. After going through google without success, checked the www.openssh.org site. The FAQ section posted the solution that - How do I go about this? Has anyone faced an issue... (2 Replies)
Discussion started by: ranj@chn
2 Replies

5. UNIX for Advanced & Expert Users

difference between logging into unix through f-secure ssh client and telnet

hi, what is the difference between logging into unix through f-secure ssh client and telnet is there any more security check is involved can any one explain thanks in advance (1 Reply)
Discussion started by: trichyselva
1 Replies

6. UNIX for Dummies Questions & Answers

How to avoid logging with root user?

I have created a linux machine and installed some softwares on it with root user privileges . I used to login with root user credentials for doing the various task. Later i have realise that this is not the best practice to follow and there should be a new user with less privileges to be created... (1 Reply)
Discussion started by: pinga123
1 Replies

7. Shell Programming and Scripting

how do i avoid system hang due to ssh in script?

I have a script that collects data from about 200 servers using 'ssh'. The problem is that, process sometime hangs at some point stopping the execution of the script. Please give me some idea how can I force the execution to jump to the next step if there arises any problem !! Thanks for replies if... (1 Reply)
Discussion started by: mdangol
1 Replies

8. Shell Programming and Scripting

How to avoid ssh :Write failed: Broken pipe?

Hello, I am trying to run some code on Matlab over ssh . The code takes around 5-6 hours to complete. so after giving the command to run it , I locked my machine and then went off to sleep at night, only to discover in the morning that I get this message : ...Code running, partial results... (1 Reply)
Discussion started by: ajayram
1 Replies

9. Shell Programming and Scripting

How to avoid multiple ssh -o StrictHostKeychecking=no?

How do i avoid multiple ssh -o StrictHostKeychecking=no in the below script. if then echo " Please mention the server name after the script" elif ssh -o StrictHostKeychecking=no $1 "" 2> /dev/null then ver=`ssh -o StrictHostKeychecking=no $1 "cat /abc/def/version" 2> /dev/null` env=`ssh... (3 Replies)
Discussion started by: NarayanaPrakash
3 Replies

10. Shell Programming and Scripting

Help with ssh,tar and logging

Hi, I'm successfully written a script which tar a directory and ssh's it over a remote server tar cfv - $SDIR | ssh $RHOST "cat > $DDIR/backup.$BKPEXT.tar" However, Im unable to log the activity to a file. i.e for example if I do tar cfv - $SDIR | ssh $RHOST "cat >... (1 Reply)
Discussion started by: maverick_here
1 Replies
SFTP-SERVER(8)						    BSD System Manager's Manual 					    SFTP-SERVER(8)

NAME
sftp-server -- SFTP server subsystem SYNOPSIS
sftp-server [-ehR] [-f log_facility] [-l log_level] [-u umask] DESCRIPTION
sftp-server is a program that speaks the server side of SFTP protocol to stdout and expects client requests from stdin. sftp-server is not intended to be called directly, but from sshd(8) using the Subsystem option. Command-line flags to sftp-server should be specified in the Subsystem declaration. See sshd_config(5) for more information. Valid options are: -e Causes sftp-server to print logging information to stderr instead of syslog for debugging. -f log_facility Specifies the facility code that is used when logging messages from sftp-server. The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. -h Displays sftp-server usage information. -l log_level Specifies which messages will be logged by sftp-server. The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. INFO and VERBOSE log transactions that sftp-server performs on behalf of the client. DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. The default is ERROR. -R Places this instance of sftp-server into a read-only mode. Attempts to open files for writing, as well as other operations that change the state of the filesystem, will be denied. -u umask Sets an explicit umask(2) to be applied to newly-created files and directories, instead of the user's default mask. For logging to work, sftp-server must be able to access /dev/log. Use of sftp-server in a chroot configuration therefore requires that syslogd(8) establish a logging socket inside the chroot directory. SEE ALSO
sftp(1), ssh(1), sshd_config(5), sshd(8) T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-filexfer-00.txt, January 2001, work in progress material. HISTORY
sftp-server first appeared in OpenBSD 2.8. AUTHORS
Markus Friedl <markus@openbsd.org> BSD
January 9, 2010 BSD
All times are GMT -4. The time now is 08:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy