i wanto hardcode password for a username to ssh to a server using script


 
Thread Tools Search this Thread
Operating Systems Solaris i wanto hardcode password for a username to ssh to a server using script
# 1  
Old 02-27-2008
i wanto hardcode password for a username to ssh to a server using script

Dear all

i want to ssh to a server via running a shell script with a username and i want to hard code the password for that particular username

can u help me please

Thank u
Naree
# 2  
Old 02-27-2008
Sure, can we see the script sample ? Also, what does 'hardcoded' mean ?
# 3  
Old 02-27-2008
What you want to do is create an ssh key for the user.
In a nutshell, create an ssh key for your user in serverA using ssh-keygen, then move the *.pub file that ssh-keygen creates to that user's .ssh directory into authorized_keys.
Then you don't need a passwd.
This is well documented. A web search should yield a detail procedure.
# 4  
Old 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
# 5  
Old 02-28-2008
It is always good to follow the procedure mentioned by #System shock.
You need not to hardcode your password anywhere.
# 6  
Old 02-28-2008
i don't know procudure

Hi all,

please can u help me .. with the procedure .. to create ssh-keygen for a user ...
there after to copy which files?

Thank U
Naree
# 7  
Old 02-28-2008
this may help you
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Run a script at remote server without ssh password

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

2. Shell Programming and Scripting

How can i su automaticaly in same server with different username and same password?

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

3. AIX

How to ssh from an AIX OS server to a Fabric OS server without password?

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

4. Shell Programming and Scripting

How to send Two different password in Single script, having same username..?

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

5. UNIX for Dummies Questions & Answers

Script to log in SFTP server [with username, password]

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

6. Shell Programming and Scripting

Logon to multiple hosts using ssh hardcode password

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

7. Shell Programming and Scripting

Asking username and password in the middle of the Shell/perl script

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

8. UNIX and Linux Applications

Regarding NFS server username/password authentication

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

9. Shell Programming and Scripting

mysqldump script without hardcode password

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

10. Shell Programming and Scripting

username password in script

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
Login or Register to Ask a Question