Sponsored Content
Top Forums UNIX for Dummies Questions & Answers For SFTP connection - How to give password in UNIX Script (ksh) Post 302739527 by Vineeta Nigam on Tuesday 4th of December 2012 10:11:03 AM
Old 12-04-2012
For SFTP connection - How to give password in UNIX Script (ksh)

Hi,

Could you please explain me how to establish the Key between two server.

Need step information which i need to follow.
My server : abc

Vital server :xyz

Please let me know how to access the xyz server by SSH key.

Notes :We don't have any other option to pass the pwd in Unix script.
Please reply me .

Thanks
Vineeta
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to give sftp a password in a shell scripit

I want to write an sftp script, but I can't put ssh keys on my destination. Is it possible to pass sftp a password inside a script? I know that the -b option makes sftp use a file for params. Can the password go in such a file? How can I do this? Thanks in advance (3 Replies)
Discussion started by: kskywr
3 Replies

2. Shell Programming and Scripting

sftp Connection from Unix to Windows 2003 server using Passphrase

Hi All, I am trying to connect from Unix machine to Windows 2003 server using passphrase method. It is connecting to the server and the connection is immediately closing. Below is the stack trace. Can anyone let me know what wrong with it? cwadmin@iut1wps1:/home/cwadmin> ssh username@targetip... (1 Reply)
Discussion started by: vijayin
1 Replies

3. Shell Programming and Scripting

sftp connection from Unix to windows

Hi guyz, I have a Solaris 5.9 box from which i need to connect to a windows server using Coreftp (passwordless login). Coreftp is installed on windows and in solaris, it is already available.I generated a pair of key(public,private) in windows and specify pub key over there, edit the know_hosts... (7 Replies)
Discussion started by: Renjesh
7 Replies

4. Shell Programming and Scripting

Password less connection(sftp/ssh)

Dear All, I'm trying to configure a passwordless connection between two servers of HP-UX. i have srearched the configuration in google so many times and as per the guidence i have done all the steps, but still its not working and every time it is asking for password while trying to scp some file... (2 Replies)
Discussion started by: panknil
2 Replies

5. Shell Programming and Scripting

SFTP connection using shell script

Hi , I am able to manually connect to remote system usning "sftp" protocol. But when I using the below command in the script but I am not able to connect. `sftp TEST01@120.34.3.4` And the connection should not be closed after login. Please help to solve this. Thanks Satya (2 Replies)
Discussion started by: Satyak
2 Replies

6. UNIX for Dummies Questions & Answers

SFTP connection to SSH2 UNIX server

Plz share how we can make a passwordless SSH connection from a SSH1 UNIX server to SSH2 UNIX server. (3 Replies)
Discussion started by: krishna87
3 Replies

7. Shell Programming and Scripting

How to give password at run time in a shell script?

hi, how can i pass a password automatically when a shell script is running. i have shell script(runscript.sh) which call another shell script inside it as a different user. runscript.sh contains su - nemo -c "/bin/main_script.sh" but when i execute "runscript.sh" it try to run... (7 Replies)
Discussion started by: Little
7 Replies

8. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

9. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies

10. Shell Programming and Scripting

Sftp connection with password

I am running this script to copy pattern files in local but it is asking for password even passing the hardcode value Script:- PASSWORD="xyz" sftp -oport=1002 user@host:/dir/archive/file*.txt /di/data/ << EOF $PASSWORD quit EOF Got error :- -bash-4.1$ sh sftp_with_password.sh... (5 Replies)
Discussion started by: himanshupant
5 Replies
nisserver(1M)                                             System Administration Commands                                             nisserver(1M)

NAME
nisserver - set up NIS+ servers SYNOPSIS
/usr/lib/nis/nisserver -r [-x] [-f] [-v] [-Y] [ -d NIS+_domain] [ -g NIS+_groupname] [-l network_passwd] /usr/lib/nis/nisserver -M [-x] [-f] [-v] [-Y] -d NIS+_domain [ -g NIS+_groupname] [ -h NIS+_server_host] /usr/lib/nis/nisserver -R [-x] [-f] [-v] [-Y] [ -d NIS+_domain] [ -h NIS+_server_host] DESCRIPTION
The nisserver shell script can be used to set up a root master, non-root master, and replica NIS+ server with level 2 security (DES). If other authentication mechanisms are configured with nisauthconf(1M), nisserver will set up a NIS+ server using those mechanisms. nisauth- conf(1M) should be used before nisserver. When setting up a new domain, this script creates the NIS+ directories (including groups_dir and org_dir) and system table objects for the domain specified. It does not populate the tables. nispopulate(1M) must be used to populate the tables. OPTIONS
-d NIS+_domain Specifies the name for the NIS+ domain. The default is your local domain. -f Forces the NIS+ server setup without prompting for confirmation. -g NIS+_groupname Specifies the NIS+ group name for the new domain. This option is not valid with -R option. The default group is admin.<domain>. -h NIS+_server_host Specifies the hostname for the NIS+ server. It must be a valid host in the local domain. Use a fully qualified hostname (for example, hostx.xyz.sun.com.) to specify a host outside of your local domain. This option is only used for setting up non-root master or replica servers. The default for non-root master server setup is to use the same list of servers as the parent domain. The default for replica server setup is the local hostname. -l network_password Specifies the network password with which to create the credentials for the root master server. This option is only used for master root server setup (-r option). If this option is not specified, the script prompts you for the login password. -M Sets up the specified host as a master server. Make sure that rpc.nisd(1M) is running on the new master server before this command is executed. -R Sets up the specified host as a replica server. Make sure that rpc.nisd is running on the new replica server. -r Sets up the server as a root master server. Use the -R option to set up a root replica server. -v Runs the script in verbose mode. -x Turns the echo mode on. The script just prints the commands that it would have executed. Note that the commands are not actually executed. The default is off. -Y Sets up a NIS+ server with NIS-compatibility mode. The default is to set up the server without NIS-compatibility mode. USAGE
Use the first synopsis of the command (-r) to set up a root master server. To run the command, you must be logged in as super-user on the server machine. Use the second synopsis of the command (-M) to set up a non-root master server for the specified domain. To run the command, you must be logged in as a NIS+ principal on a NIS+ machine and have write permission to the parent directory of the domain that you are setting up. The new non-root master server machine must already be an NIS+ client (see nisclient(1M)) and have the rpc.nisd(1M) daemon running. Use the third synopsis of the command (-R) to set up a replica server for both root and non-root domains. To run the command, you must be logged in as a NIS+ principal on a NIS+ machine and have write permission to the parent directory of the domain that you are replicating. The new non-root replica server machine must already be an NIS+ client and have the rpc.nisd daemon running. EXAMPLES
Example 1: Setting up Servers To set up a root master server for domain sun.com.: root_server# /usr/lib/nis/nisserver -r -d sun.com. For the following examples make sure that the new servers are NIS+ clients and that rpc.nisd is running on these hosts before executing nisserver. To set up a replica server for the sun.com. domain on host sunreplica: root_server# /usr/lib/nis/nisserver -R -d sun.com. -h sunrep To set up a non-root master server for domain xyz.sun.com. on host sunxyz with the NIS+ groupname as admin-mgr.xyz.sun.com.: root_server# /usr/lib/nis/nisserver -M -d xyz.sun.com. -h sunxyz -g admin-mgr.xyz.sun.com. To set up a non-root replica server for domain xyz.sun.com. on host sunabc: sunxyz# /usr/lib/nis/nisserver -R -d xyz.sun.com. -h sunabc ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
nis+(1), nisgrpadm(1), nismkdir(1), nisaddcred(1M), nisauthconf(1M), nisclient(1M), nisinit(1M), nispopulate(1M), nisprefadm(1M), nis- setup(1M), rpc.nisd(1M), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 13 Dec 2001 nisserver(1M)
All times are GMT -4. The time now is 12:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy