Tuesday, October 15, 2013

likewise registry changes

There are two ways to edit home directory and shell in Likewise:

1.  lwconfig
2.  lwregshell

and no, hacking the xml files do not work.

lwconfig

command line joy.  fun.  sadly, sometimes it has null and cache issues.

/opt/likewise/bin/lwconfig --detail AssumeDefaultDomain
/opt/likewise/bin/lwconfig AssumeDefaultDomain true
/opt/likewise/bin/lwconfig --show AssumeDefaultDomain 
/opt/likewise/bin/lwconfig LoginShellTemplate /bin/bash
/opt/likewise/bin/lwconfig HomeDirPrefix /home
/opt/likewise/bin/lwconfig HomeDirTemplate %H/%U
/opt/likewise/bin/lwconfig CreateHomeDir false
echo 'MYDOMAINS\\domain^admins ALL=(ALL) ALL' >> /etc/sudoers
  
restart the Likewise services"
   
/opt/likewise/bin/lwsm restart lwio
  
  
lwregshell

the registry editing tool.
   
/opt/likewise/bin/lwregshell

In the lsass branch, there are two keys that contain entries for the 
home directory and shell. One is for the Active Directory provider, the other is for
the Local provider. 

to get to the locations:
   
cd HKEY_THIS_MACHINE\Services\lsass\Parameters\Providers\ActiveDirectory
set_value LoginShellTemplate /bin/bash
set_value HomeDirTemplate %H/%U
cd HKEY_THIS_MACHINE\Services\lsass\Parameters\Providers\Local
set_value LoginShellTemplate /bin/bash
set_value HomeDirTemplate %H/%U

Refresh configuration without agent restart (unlike with lwconfig):

/opt/likewise/bin/lw-refresh-configuration

show hidden directories osx

osx hides directories in finder.

do an ls -lO and you'll see:
"hidden" 

to make unhiddened:
# chflags unhidden directory

Wednesday, October 9, 2013

adventures in reverse record creation and ms-dns

ms-dns is bind sometimes mostly.

someone not me created a whole bunch of reverse subnets weirdly.

10.x.x.x Subnet with the subdomains 123 and subdomains 11, 12, 13, 14, 15.  pretty in a gui.  but, hey.

however, when I attempt to create a PTR via dnscmd, a la:

dnscmd /RecordAdd 123.10.in-addr.arpa 1.11 PTR system001.elevennetwork.local

i get unhappy zone not existing and other silliness.

dnscmd /enumzones

i see, among others:

10.in-addr.arpa

oh, i see.  nice.  okay.

dnscmd /RecordAdd 1.11.128 PTR system001.elevennetwork.local

works!

but i a zillion of these addresses.  i simply cannot do this by hand.

i create a file with all of my tasty records however i do as such:

2.11.123 system002.elevennetwork.local
3.11.123 system003.elevennetwork.local
24.12.123 system024.twelvenetwork.local
... you get the hint ...

for /f "tokens=1-2" %i in (tastyrecords) do dnscmd %LOGONSERVER% /RecordAdd 10.in-addr.arpa %i PTR %j

and it works.

Monday, October 7, 2013

enable root telnet on gentoo

as the title says...
/etc/securetty

tty0
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
tty12

tts/0
ttyS0 

pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
add the above for 10 exciting telnet sessions.

Thursday, October 3, 2013

ssh hopscotch

hot damn my job is fun.
me on system1 is pubkeyed on system2, but not system3.
toor on system2 is pubkeyed on system3.
me needs to run something on system3
ssh magic!

me@system1:~$ ssh toor@system2 "ssh notme@system3 \"ls -la ~\""
and here's a real world example of the excitement from a correspondent we shall call dr. excitement...
scp %1* 10.100.100.117:~/
ssh 10.100.100.117 "ssh 192.168.1.132 \"sudo service tomcat7 stop;sudo rm -v /var/lib/tomcat7/webapps/somethingneat.war\""
ssh 10.100.100.117 "scp %1.war 192.168.1.132:~/"
ssh 10.100.100.117 "ssh 192.168.1.132 \"sudo cp -v ~/%1.war /var/lib/tomcat7/webapps/somethingneat.war; sudo chown -v tomcat7 /var/lib/tomcat7/webapps/somethingneat.war; sudo service tomcat7 start\""
echo woo\!