LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-20-2023, 12:15 PM   #1
TVining
LQ Newbie
 
Registered: Jan 2021
Posts: 19

Rep: Reputation: Disabled
Question plink script build


Anyone in here able to build me a quick plink script for debian machines?
I want it to log in, go to SUDO and run an adduser command, log out, and log any resulting messages. Move on to the next machine, do the same.
if the commands were in a second text file that I could modify easily, that'd be a bonus.

Thank You!
 
Old 07-21-2023, 06:18 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
I would rather implement it in a shell script, copy it to the target host and execute (and repeat)
 
Old 07-21-2023, 07:11 AM   #3
TVining
LQ Newbie
 
Registered: Jan 2021
Posts: 19

Original Poster
Rep: Reputation: Disabled
I would rather see that, too. However I'm limited on what tools the windows machines allow to be run, and plink is one that it does.
I normally load the files I use for an upgrade to the windows servers, do the upgrade to the Deb11 machines, and then delete the files, so I'm not concerned about storing the plain text password- it's literally only on the machine an hour at most, and the server has a very narrow allowance of people able to log in.
 
Old 07-21-2023, 07:28 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
no, the shell script should run on the linux host, on windows you do nothing, just copy it to the remote server and start it (using putty).
 
Old 07-21-2023, 07:36 AM   #5
TVining
LQ Newbie
 
Registered: Jan 2021
Posts: 19

Original Poster
Rep: Reputation: Disabled
The idea is to not have to individually log into each linux host (about 200 of them) to run the script.
The Debian machines are very stripped with extremely limited tools on them, but bash scripts can be run.
I also would like a single log file that tells me what host and the results. (knowing of course that if the account was created, there is no CLI feedback, but if the account was there, it will tell me that).
 
Old 07-21-2023, 09:56 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
By limited I am guessing you need a Windows batch versus powershell script? plink can read commands from a text file using the -m option. I rarely need to write a batch script and it takes me a bit of effort to remember its syntax as compared to linux scripting...

Your asking members who volunteer their time to write the script for you instead of helping is considered rude by some.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XMing/PLink won't cooperate... richardh1970 Linux - Software 1 10-21-2008 08:09 AM
How to use Putty(plink command line) to using application keypad settings to VT400? hocheetiong Linux - Newbie 1 08-14-2008 08:47 AM
xming, plink, and startkde not working kavius General 5 07-18-2008 10:48 AM
Can't change shell in plink shell script? lhouk Programming 2 08-02-2007 02:47 PM
is there a plink for linux ? alix123 Programming 1 05-08-2007 01:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration