423 reputation
314
bio website
location Seattle, WA
age
visits member for 3 years, 10 months
seen Aug 17 at 22:36

Dec
28
comment How can I implement ansible with per-host passwords, securely?
In the hosts file, you should be able to specify ansible_ssh_user= and ansible_ssh_password= per host. These will be used when actually using ansible-playbook (not command line ansible).
Dec
23
comment How can I implement ansible with per-host passwords, securely?
This may not be exactly what you're looking for, but on Ubuntu boxes I still use keys, i.e. putting my public key in /root/authorized_keys to get in directly as root. Obvious drawback is allowing root logins over ssh... I also disallow password logins over ssh and run fail2ban for added security.
Jul
1
comment Close/Quit All Screens with SSH
But, using byobu makes this very easy since it will show if you on login if existing / multiple sessions are open, and allow you to kill any/all of them.
Jun
19
comment Bash: Call shell script but do not wait for return code
right after you fork the process, you can "capture" its PID with $!. E.g. mypid=$! . I recommend then using wait $mypid at some point in your script to ensure that the forked process ends before ending the script.
Jun
12
comment “while read line” returns early when calling ssh “mysql…”
It's the done 3< <(printf %s "$results") line.
Jun
12
comment “while read line” returns early when calling ssh “mysql…”
This solution doesn't seem to work at all. Bash just complains giving "syntax error". Bash version = GNU bash, version 4.2.42(1)-release
Jun
6
comment “while read line” returns early when calling ssh “mysql…”
It is actually within double quotes. The single quotes themselves are also within the double quotes; the very reason why I used them there. The ssh command itself works great, it just for whatever reason ends the while read line loop.
Jun
6
comment “while read line” returns early when calling ssh “mysql…”
that's previously defined. I cleaned up portions of the code that have any specific details that aren't needed.
Jun
6
comment “while read line” returns early when calling ssh “mysql…”
Ah, I messed with that line for posting to serverfault. There is indeed a ")" at the end. In fact, it works properly, but only for one line of data.
Apr
19
comment bash: use outside variables when reading multiple lines into ssh
This did it. One must escape the remotely created variables like \$variablename, while simply referring to a $variable expands it from your local shell. Thanks.
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
Thanks for the tip about -T. At first I thought removing /bin/bash solved my problems... but on further testing it's still not expanding the variables within the heredoc.
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
I added /bin/bash to ssh because without it I get the error: Pseudo-terminal will not be allocated because stdin is not a terminal. That error doesn't seem to actually break anything though.
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
For some reason I get strange things happening when I don't use the backslash. For example, my shell seems to pause for over a minute and I get an error later on that mysql can't connect to the server, as if the commands were actually running locally and not on the remote ssh server. I have verified that within the here-doc setting the serverpath var works as expected. I need to be able to set out outside of that here-doc though.
Apr
18
comment I want to filter out two lines from the output of a program
not sure why you'd want to invert the match... for me grep -E "Schedule:|Something Level:" filename works perfectly.
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
$( ) runs its inner commands in a subshell, so referring to any variable like that doesn't seem to work in bash.
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
I always quote just based on info like : mywiki.wooledge.org/BashPitfalls#cp_.24file_.24target .
Nov
29
comment Samba4 advice for production use
I have quite a bit of experience with it. I have been using zentyal3 on one server now for a while. It has it quirks and their forums can be hit and miss, but for the most part everything just works.
Sep
26
comment How run on the boot .sh script
I believe it is meant to be /etc/rc.local.
Sep
26
comment Windows clients cannot access machine running DHCP server
Also, I highly recommend using netcfg to set up networking on Arch Linux. See wiki.archlinux.org/index.php/Netcfg.
Sep
25
comment Windows clients cannot access machine running DHCP server
Check out en.gentoo-wiki.com/wiki/DHCP, specifically the "option routers 192.168.1.1;" line.