Writing a script to access many servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Writing a script to access many servers
# 1  
Old 10-14-2014
Writing a script to access many servers

Hi there,

I'm writing a simple script (in a batch file) to access a number of servers with a number of different credentials (users/passwords/root passwords etc). What I need is a way to execute commands as root. I'm currently using the batch file to read the server information out of a text file one by one (with usernames/passwords) and then using plink to connect to servers and a text file with commands in to download/install what I need to. The problem comes when I need to be root to install the software.

Now i've seen many threads on the internet stating that it's practically impossible to gain root through doing su and dealing with a prompt for the password. I've done alot of playing around but to no avail.

What i'm wondering is if there is any way to get around this? I'm aware of Expect but I can't install that on all of the servers. Maybe someway I can log in and gain su rights at the same time?
# 2  
Old 10-14-2014
If you want to login as root, arrange sudo in advance. If you want to ssh in without a password, arrange ssh keys in advance.

If you are not permitted to do these, I doubt you are permitted to insecurely bruteforce a plaintext login with a plink password either.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 10-14-2014
Thanks very much for the reply.

I suspected as much, I know the solution i'm trying is far from elegant. I'll see if I can arrange sudo for the install I need.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script to validate the access for Servers

Hi Experts, Please advise to Write a Shell script, To check , whether the user has access to UNIX PRODUCTION server or not? If no, then need to provide the access to UNIX PRODUCTION server and then need to provide access to print only few FILES. After connecting to ther server, again... (5 Replies)
Discussion started by: vasuvv
5 Replies

2. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

3. AIX

Why access to the servers is denied?

There is one aix server, IP is 152.240.28.14, the user IP is 152.240.88.64, The user is able to get access briefly then all access is denied from the whole subnet 152.240.88.0. a short while later access is granted and the same thing happens all over again. The customer is able to... (7 Replies)
Discussion started by: rainbow_bean
7 Replies

4. UNIX for Advanced & Expert Users

Script to access multiple linux servers to get system details such as CPU usage

Hi Is there any shell script that accesses multiple linux servers to get details such as CPU usage, RAM used etc. The access of the servers must be parallel not serial in the sense it must ping all the servers at a time to get information.The script has to be triggered from a host system and get... (7 Replies)
Discussion started by: mssrivatsa
7 Replies

5. Shell Programming and Scripting

Help in writing script

i need some help in donig some actions on files in a library. i want to get the n last files, and print to the screen their name, date, and how many times a specific string appears in each file.. how can i do this..?... (6 Replies)
Discussion started by: eee
6 Replies

6. Red Hat

writing a script

Dear Madam/Sir Who can help me with writing a script doing the following? 1- Read names of files (only files with special name format let say initially they have the same file name start like TT*) 2- Then create an empty files with the same names have been read in step one but with extension... (1 Reply)
Discussion started by: m.nageeb
1 Replies

7. Shell Programming and Scripting

Help in writing a script

Hey everyone Can anyone please write me a script to display numbers in descending order dynamically i.e if the user enter a number say 100 then the output should be like 100 99 ....so on till 0 I tried using the logic as for ((i =1; i<=100; i--) but the it goes into a infinite loop since even the... (7 Replies)
Discussion started by: icchi
7 Replies

8. Shell Programming and Scripting

Help me in writing the script

Hi, I have written a script which converts a give hexdecimal value to binary value in perl. But now, the problem is I should read every bit of it ( if its 10101010, i should read the value in each position and if the value in that position is 1 i should print a string and should exit if its... (1 Reply)
Discussion started by: prakashreddy
1 Replies

9. Shell Programming and Scripting

Writing the script

I whant write the script of monitoring my servers on night-active users. He must loging all user actions, when user login, when logout, when he do su etc. But i don't know with what to begin :( How command i can use? awk, sed, last And what logs i can use too? /var/log/messages, /var/log/secure... (1 Reply)
Discussion started by: jess_t03
1 Replies

10. UNIX for Dummies Questions & Answers

cannot access host servers from Exceed

we're having problems logging into host servers thru X-window(we use hummingbird exceed)...If I have 10 host servers, I only see 3 servers from exceed which I can access. I'm not sure whether this is a exceed x-window problems or host server problms or NFS problems or NIS problems?..no... (4 Replies)
Discussion started by: dookeobih
4 Replies
Login or Register to Ask a Question