02-28-2008
i mean that...
i want to hard code password for a particular user mean that
i have written a shell script like this:
ssh user@hostname
password <password>
cd dir
exit
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script??
something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies
2. Shell Programming and Scripting
OS: Linux ambglx02 2.6.16.60-0.21-default #1 Tue May 6 12:41:02 UTC 2008 i686 i686 i386 GNU/Linux
Shell: bash
Currently I have a mysqldump script to backup my mysql database, the command is as below:
/opt/novell/mysql/bin/mysqldump --add-drop-table -u root -p -h mydb > /home/john/mydb.sql
... (5 Replies)
Discussion started by: bulkbiz
5 Replies
3. UNIX and Linux Applications
Hi;
I had set up NFS server in one ubuntu box and mounted few directories using it.
In order to access those directories across the network i m using j-ftp(an open source java network client) from other boxes in the same network.I am able to view my mounted directories in the server through it.... (1 Reply)
Discussion started by: ajaypadvi
1 Replies
4. Shell Programming and Scripting
Can any body help me to find out the logic
I have a script chkcomponent.pl Which give some output
Like
component1 userid: u1
component2 userid: u2
component3 userid: u1
.
.
#The no of components are different in different times run
Now I want this chkcomponent.pl script... (1 Reply)
Discussion started by: pareshpatra
1 Replies
5. Shell Programming and Scripting
Hi im trying to write a script to logon to list of servers with same userID. I have no option/plan to implement ssh-keygen sharing between the systems, so i have written script creating 2 files,
file1 holds list of hosts
host1
host2
host3
file2 has following script
for i in `cat file1`... (1 Reply)
Discussion started by: dreamaix
1 Replies
6. UNIX for Dummies Questions & Answers
Hi, everyone, I am trying to write a script to login automatically using username and password to an sftp server (the key authentication has been disabled so I cannot use that method).
I tried to search online for a solution and found a way using "expect" but my boss does not want me to use... (4 Replies)
Discussion started by: warmboy610
4 Replies
7. Shell Programming and Scripting
Hi Team,
i want to input two password for single node like pass1/pass2 one of the pass1 is working some node and pass2 is working for some nodes .
For nodes having pass1 i have to run different script and
for nodes having pass2 i have to run different script
Sooo
how can put two pass... (3 Replies)
Discussion started by: Ganesh Mankar
3 Replies
8. AIX
Hi
I'd like to ssh from an AIX OS server ( v5.3) to a Fabric OS server ( v6.1.2 ) without password.
I tried using dsa or rsa keys but it didn't work, the aix server still asked for the password.
Somebody help, please :(:(:( (8 Replies)
Discussion started by: bobochacha29
8 Replies
9. Shell Programming and Scripting
Hi I am new to shell scripting,
Can you please help me in writing a script that can switch user in same server with different user name and same password.
I want to perform some functional task in a particular user and need to switch user and perform same activity in another user and so on ...
... (4 Replies)
Discussion started by: Dew
4 Replies
10. Ubuntu
Hello,
What I want to do is to run a file on remote server by running a script at localhost but script should not ask ssh password of my remote server when script is executed.
Scenario1:
To copy files from server2 to data server:$ scp -r root@server2_ip:/var/www/html/*.* /var/
When I enter... (6 Replies)
Discussion started by: baris35
6 Replies
LEARN ABOUT PHP
ssh2_auth_pubkey_file
SSH2_AUTH_PUBKEY_FILE(3) 1 SSH2_AUTH_PUBKEY_FILE(3)
ssh2_auth_pubkey_file - Authenticate using a public key
SYNOPSIS
bool ssh2_auth_pubkey_file (resource $session, string $username, string $pubkeyfile, string $privkeyfile, [string $passphrase])
DESCRIPTION
Authenticate using a public key read from a file.
PARAMETERS
o $session
- An SSH connection link identifier, obtained from a call to ssh2_connect(3).
o $username
-
o $pubkeyfile
- The public key file needs to be in OpenSSH's format. It should look something like: ssh-rsa AAAAB3NzaC1yc2EAAA....NX6sqSnHA8=
rsa-key-20121110
o $privkeyfile
-
o $passphrase
- If $privkeyfile is encrypted (which it should be), the $passphrase must be provided.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Authentication using a public key
<?php
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_pubkey_file($connection, 'username',
'/home/username/.ssh/id_rsa.pub',
'/home/username/.ssh/id_rsa', 'secret')) {
echo "Public Key Authentication Successful
";
} else {
die('Public Key Authentication Failed');
}
?>
NOTES
Note
The underlying libssh library doesn't support partial auths very cleanly That is, if you need to supply both a public key and a
password it will appear as if this function has failed. In this particular case a failure from this call may just mean that auth
hasn't been completed yet. You would need to ignore this failure and continue on and call ssh2_auth_password(3) in order to complete
authentication.
PHP Documentation Group SSH2_AUTH_PUBKEY_FILE(3)