All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

How to write an “expect” script that checks if the supplied password matches one of multiple possible passwords?

I want to change the password on my server. There are four possible passwords that should all be accepted for changing a password on the server. To achieve this I want write an "expect" script ...
0
votes
1answer
26 views

Manually enter password into expect and use as variable while scrip is running

I have an expect script that uses interact every time a password is needed. The program that expect is automating asks for the password multiple times. Is there a way to only have to type the ...
0
votes
1answer
58 views

Telnet connection Procurve switch

Im writing a script to get a dump of the Procurve switch-settings I start the script like this: ./script.sh | tee /home/user/telnet.log Here the Script #!/usr/bin/expect -f set timeout 20 set ...
2
votes
1answer
2k views

Expect script to ssh into a remote host and change its password

So recently I have been working on a small script that will login to a remote unix host and change its password, I've never had much experience with expect so its been an upward learning curve. The ...
1
vote
1answer
1k views

script ssh login to server and pass root password

I have written an expect script to automate the login process for ssh. My user account has rsa keys setup but once I log in I want to switch to root but the remote server is hanging on the password. I ...
1
vote
2answers
1k views

Cracking root user: Automating logging into root using “su” from nonroot user

I want to write a script that allows me to pass a password to the su command. The reason for this is to automate the process of logging into root from nonroot account. From my basic understanding of ...
1
vote
1answer
383 views

Automating setup of the SSH tunnel

I need to frequently login to many machines but I can only login to them from a proxy machine or using an SSH tunnel (by tunneling through that proxy machine). The problem is that I cannot use ...
1
vote
1answer
684 views

How to safely put user typed password into a file?

Is there any way to put the password typed by user into a file (either in Unix or in expect). read -s -p "enter password" input echo $input > file Is the above code safe? I want to use that ...
29
votes
10answers
192k views

Shell Script for logging into a ssh server

I tried writing a shell script which can do automatic login into a ssh server using password which is mentioned in the script. I have written the following code: set timeout 30 /usr/bin/ssh -p 8484 ...
3
votes
4answers
4k views

passing passwords to a script

I want to scp a file to a remote host, and from there, run a command on the file, and exit the remote session. If I write a usual script, call scp and then ssh, I am prompted to enter two passwords. ...