hoxt.com
域名年龄: 21年6个月18天HTTP/1.1 301 永久重定向 访问时间:2016年09月18日 07:55:44 服务器:Apache/2.2.15 (CentOS) X-Pingback: http://hoxt.com/xmlrpc.php 目标网址:http://hoxt.com/ 文件大小:0 连接:关闭 类型:text/html; charset=UTF-8 HTTP/1.1 200 OK 访问时间:2016年09月18日 07:55:44 服务器:Apache/2.2.15 (CentOS) X-Pingback: http://hoxt.com/xmlrpc.php 连接:关闭 Transfer-Encoding: chunked 类型:text/html; charset=UTF-8 网站编码:UTF-8
Hoxt.com – Open Source Mirrors Apache, CPAN, PHP, MySQL, PuTTY, Linux Virtual Server, Linux Documentation Project, ProFTPDSubscribe via RSSHomeAbout17Jul/100Install OSSEC automatically with expectIf you want to script the installation of ossec, this script will use expect/spawn to automatically enter values for prompts:#!/usr/bin/expect -dset timeout -1spawn ossec-hids-2.4.1/install.shexpect "en/br/cn/de"send "en\r"expect "Press ENTER to continue"send "\r"expect "What kind of installation"send "local\r"expect "Choose where to install the OSSEC HIDS"send "\r"expect "Do you want e-mail notification"send "y\r"expect "your e-mail address"send "root@localhost\r"expect "Do you want to use it"send "y\r"expect "Do you want to run the integrity check daemon"send "y\r"expect "Do you want to run the rootkit detection engine"send "y\r"expect "Do you want to enable active response"send "y\r"expect "Do you want to enable the firewall-drop response"send "y\r"expect "Do you want to add more IPs to the white list"send "n\r"expect "Press ENTER to continue"send "\r"expect "Press ENTER to finish"send "\r"expect eofTagged as: puppet, securityNo Comments7Jul/100shell scripting – Bash alias that takes argumentNormally, you would have this shortcut in .bash_profilealias sshwww='ssh john@www.example.com'What about you have 100s of www servers:sshwww() { ssh "john@$1".example.com; }Usage: "sshwww web1", "sshwww web2"Even more, you can su directly to root from john:sshroot() { ssh "john@$1".example.com "su"; }Usage: "sshroot web1", "sshroot web2"Filed under: UncategorizedNo Comments7Jul/100Make an encrypted password for useraddVery simple using php:php -r "echo crypt('myplaintextpassword123');"useradd -m -p "$1$abJez234$fD4Dn4IrG3Hzeas3hBjIb0" -d /home/john -s /bin/bash johnFiled under: UncategorizedNo Comments7Jul/100su – Run a command after entering root passwordFor a better scripting automation and still retain the security of su/non-root login:su -c "mysql -e 'SHOW STATUS;' "This will return the status of mysql. Now you can run this via a regular user, then su, then mysql. You'll be asked for password twice, one for the regular user, one for root.ssh nonroot@server "su -c \"mysql -e 'SHOW STATUS;' \""You'll get "standard in must be a tty" error. Too bad! Nice concept but does not work like this. Now to solve this, I've seen some suggestion to use an expect script but not supplying the root password automatically. The expect script will ask for the password.Update: no need for expect script, with just an ssh option "-t" to force it to ask for a tty (see man page for description). So the solution is this:ssh -t nonroot@server "su -c \"mysql -e 'SHOW STATUS;' \""Security is still there, you'll be asked for two different passwords, but you can now write a script to guide the process flow as you expected and not having to teach/say/request/instruct users to type in a certain command (eg: then type su, then type your xxx command). Love it eh!Filed under: Un
© 2010 - 2020 网站综合信息查询 同IP网站查询 相关类似网站查询 网站备案查询网站地图 最新查询 最近更新 优秀网站 热门网站 全部网站 同IP查询 备案查询
2025-05-08 13:23, Process in 0.0066 second.