2015 m. gegužės 28 d., ketvirtadienis

wake-on-lan linux komanda

Naudojant nmap: nmap --script broadcast-wake-on-lan --script-args broadcast-wake-on-lan.MAC='00:12:34:56:78:9A' Naudojant etherwake: $ sudo aptitude install etherwake wakeonlan MAC-Adresas Išjungti kompiuterį nuotoliniu būdu galima komanda: net rpc shutdown -I IPADDRESS -U USERNAME%PASSWORD Literatūra:
http://www.cyberciti.biz/tips/linux-send-wake-on-lan-wol-magic-packets.html - etherwake naudojimas.
http://lifehacker.com/5275652/shut-down-your-windows-pc-remotely-from-linux - nuotolinis išjungimas.

Kaip ištrinti SystemD

Inicializacijos proceso tikrinimas:
$ ps -e | head
  PID TTY          TIME CMD
    1 ?        00:00:01 systemd

Arba galima patikrinti su strings programa, kuri yra binutils pakete:
$ sudo strings /sbin/init | grep -i {systemd; upstart}

SystemD trynimas:
# apt-get install sysvinit-core sysvinit sysvinit-utils
# apt-get remove --purge --auto-remove systemd

Tam, kad  lennartasD neryžtų:
# echo -e 'Package: *systemd*\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd

ssh saugumas ir komandos

CentOS7 ssh konfigūravimas.

Katalogų kūrimas.
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Viešo ir privataus rakto generavimas.
$ ssh-keygen 

Viešojo rakto kopijavimas į serverį.
$ ssh-copy-id vartotojas@ip 

Nuotolinės komandos siuntimas:
$ ssh root@ip hostname

Nustatymas leidžiantis root jungtis per ssh:
PermitRootLogin yes


Pasiskaitymui:
https://abdussamad.com/archives/365-CentOS-Linux:-Secure-password-less-SSH-access.html
https://freedompenguin.com/articles/how-to/ssh-is-for-dummies-too/ - kaip naudoti ssh.
Rasbery ssh komandos

2015 m. gegužės 22 d., penktadienis

Windows troublešaudimo įrankiai

Procesų stebėjimas: 
https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx


Įrangis ping'o monitoringui:
http://www.colasoft.com/ping_tool/


#Rodo ip intefasų konfiguracija
netsh interface ip show config

#arba

netsh
interface ipv4
show config
netsh interface ipv4 show config

#ištrina arp lenteles
arp -d


#ipv6
netsh
interface ipv6
show neighbours

#pinginant iš ipv6
ping -6 ip
trace rt -d -6 ip ..


#Bendra infoc
NET USER loginname /DOMAIN

#Paskutinį kartą pakeistas slaptažodis
NET USER loginname /DOMAIN | FIND /I "Password last set"


#Kaip rasti netbios vardą is ip
nbtstat /a 192.168.22.212


#ps remoting
winrs -r:HP-IT cmd

#komandų leidimas
winrs -r:HP-IT ipconfig

#dir komanda
winrs -r:HP-IT "dir c:\"

#servisu statuso keitimas
winrs -r:HP-IT "net start/stop spooler"


Literatūra:

http://michlstechblog.info/blog/windows-show-and-configure-network-settings-using-netsh/

2015 m. gegužės 7 d., ketvirtadienis

HKEY_USERS regitrų grupės modifikavimas

//Parodo vartotoju sid
gwmi win32_userprofile | ft localpath, sid

//Gauna konkretaus userio ssid
$objUser = New-Object System.Security.Principal.NTAccount("MARK")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.Value

//Gauna userio sid(trumpesnis)
$User = New-Object System.Security.Principal.NTAccount($env:UserName)
$sid = $User.Translate([System.Security.Principal.SecurityIdentifier]).value


//Randa Username pagal ssid
$objSID = New-Object System.Security.Principal.SecurityIdentifier `
    ("S-1-5-21-1454471165-1004335555-1606985555-5555")
$objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
$objUser.Value

//Importuoti iš čia

From your user you should have exported the key
HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels
which would be "virtual" key of current logged user (it has no data, it just links to current logged user).


//prideda bendra registrą
reg add HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels

//kitas būdas
The location of where new profiles copy their user registry settings is located on the file system at %SystemDrive%\Users\Default\NTUSER.DAT in Windows 7 and Windows Vista, in Windows XP it is located at %SystemDrive%\Documents and Settings\Default User\NTUSER.DAT. Now that we know what file is copied to create all new profile user registry settings we just need a way to edit the settings. Well there’s a tool for that, it’s called Regedit.exe.

The trick with editing the default user profile registry settings is to first know that it is not available in Regedit.exe by default. We will need to load the NTUSER.DAT file into Regedit.exe to be able to edit the settings. Open Regedit.exe by going to Start and typing Regedit, then right-click the search result and select Run as administrator. If you are currently logged on with a non-administrator the User Account Control box will allow you to provide administrative credentials, otherwise click Yes in the UAC box.

When Regedit starts, navigate to HKEY_USERS and left click it.

https://micksmix.wordpress.com/2012/01/13/update-a-registry-key-for-all-users-on-a-system/
http://blogs.technet.com/b/chad/archive/2012/04/25/tip-49-how-do-you-set-default-user-profile-registry-settings.aspx
https://support.microsoft.com/en-us/kb/146050