problem with sshpass


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting problem with sshpass
# 1  
Old 08-24-2011
problem with sshpass

Hello

i am using sshpass to pass remote password into script

but phase some problems when try to execute some commands remotely
which means that the remote env not passed through sshpass

for example
Code:
sshpass -p 'XXX' ssh -o StrictHostKeyChecking=no -l myserver myserver visu_fis_pnes

ksh: visu_fis_pnes:  not found.

even i add . ./profile , or execute the full path for the command
also tried to add "" and '' but not working too

my question is how to execute the remote profile automatically ? as if i connect with normal ssh ?

may be there is some options for ssh command to add ?

thanks to help

Last edited by pludi; 08-25-2011 at 04:25 AM..
# 2  
Old 08-24-2011
You are aware that using sshpass means everyone on the system can see the password?

Try creating ssh keys and using ssh, you'll no longer need to kludge plaintext passwords into your script in an insecure manner. Google 'passwordless ssh'.
# 3  
Old 08-24-2011
Quote:
Originally Posted by Corona688
You are aware that using sshpass means everyone on the system can see the password?

Try creating ssh keys and using ssh, you'll no longer need to kludge plaintext passwords into your script in an insecure manner. Google 'passwordless ssh'.
hello

yes you right its not safe but this is the allowed option now to me due to company rules

thanks if you help
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to pass password as a variable for sshpass authentication?

Using below below command i'm able to connect or authenticate server, In below command password contains special characters sshpass -v -p 'ASJBA%hs76)#' ssh -q -o ConnectTimeout=5 hostname But If I pass password as a variable I'm not able to connect or authenticate server, can you please help... (1 Reply)
Discussion started by: sam@sam
1 Replies

2. Shell Programming and Scripting

Put a command into router through sshpass bash script

hello, i am facing some issue. I am using a simple bash script that via sshpass put a command into router. Now, problem is that i have a file and commands into it. sshpass -p $pass ssh -o $log -n $user@$h /ip address set address=10.0.0.1/24 so if I have that command ip address set ... (0 Replies)
Discussion started by: tomislav91
0 Replies

3. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

4. Shell Programming and Scripting

Cannot sshpass router

Hi, I am trying to use sshpass to login to my router and then execute a reboot command. But the command never executes, can someone please help me. This doesnt work.... sshpass -p 'password' ssh 192.168.1.1 -l root -o StrictHostKeyChecking=no "sys reboot" However if I try following then it... (4 Replies)
Discussion started by: jeetz
4 Replies

5. Shell Programming and Scripting

scp with sshpass

Hi! I'm trying to copy a set of files from server1 to server2. I'm doing this from server3. Using the sshpass functionality, can I accomplish this? This is what I have so far, but this doesn't work: user@server3#~ sshpass -p 'password' scp user1@server1:/path/from/*... (10 Replies)
Discussion started by: mathbalaji
10 Replies

6. Solaris

How to install SSHPASS on Solaris ???

Could you please let me know the steps: how to install sshpass command tool in solaris any version greater than 8. (2 Replies)
Discussion started by: lohith.dutta
2 Replies

7. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

8. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies
Login or Register to Ask a Question