$ ssh-keygen
You can just press enter to create a rsa key pair;
.ssh/id_rsa is your priviate key stays in this machine
.ssh/id_rsa.pub is the public key you need to copy to the remote machine
I would suggest to use a passphrase, which only need to enter once for each OS boot
$ ssh-copy-id username@remote.machine.com
It copies the public key from local machine to a remote machine, and stores it at .ssh/authorized_key file
Tuesday, July 2, 2013
Monday, July 1, 2013
Some commands related to networking on Linux
Network Device Up and Down
$ service network restart
$ /etc/init.d/network restart
$ service network start
$ service network stop
$ifdown eth0
$ifup eth0
$ ifconfig
$ dhclient
Name Server
$ vim /ect/resolv.conf
[root@sr1s1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 129.174.97.3
nameserver 129.174.68.227
nameserver 129.174.1.3
HostName
$ echo hostname=$HOSTNAME >> /etc/sysconfig/network
set hostname
Routing Table
$ route
show the routing tables
IP Table
$ iptables --list
view all of the ip table rules
Opening Ports
$lsof -i
Start SSH
$ service sshd restart
Automatically Start SSH on Boot
$ chkconfig --level 5 --del sshd
$ chkconfig --level 5 --add sshd
Query system running service
$ chkconfig
Update bashrc or profile
$ source ~/.profile
$ service network restart
$ /etc/init.d/network restart
$ service network start
$ service network stop
$ifdown eth0
$ifup eth0
$ ifconfig
$ dhclient
Name Server
$ vim /ect/resolv.conf
[root@sr1s1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 129.174.97.3
nameserver 129.174.68.227
nameserver 129.174.1.3
HostName
$ echo hostname=$HOSTNAME >> /etc/sysconfig/network
set hostname
Routing Table
$ route
show the routing tables
IP Table
$ iptables --list
view all of the ip table rules
Opening Ports
$lsof -i
Start SSH
$ service sshd restart
Automatically Start SSH on Boot
$ chkconfig --level 5 --del sshd
$ chkconfig --level 5 --add sshd
Query system running service
$ chkconfig
Update bashrc or profile
$ source ~/.profile
Thursday, June 20, 2013
Install OpenVZ on CentOS
Installation: I successfully installed OpenVZ on CentOS 6.4, but CentOS 5.5 has booting problem after switching to OpenVZ kernel
http://openvz.org/Quick_installation
https://openvz.org/Quick_Installation_CentOS_6
Create and Run a Container:
http://openvz.org/Basic_operations_in_OpenVZ_environment
http://openvz.org/Quick_installation
http://openvz.org/Quick_installation
https://openvz.org/Quick_Installation_CentOS_6
Create and Run a Container:
http://openvz.org/Basic_operations_in_OpenVZ_environment
http://openvz.org/Quick_installation
Change hostname on CentOS
$vim /etc/sysconfig/network
Change the HOSTNAME to anything you like
e.g.: sr1s5
Change the HOSTNAME to anything you like
e.g.: sr1s5
Thursday, June 13, 2013
fix touchpad sensitive issue on ubuntu of Chromebook
http://craigerrington.com/blog/fixing-touchpad-issues-on-arm-chromebook-chrubuntu/
mkdir ~/backup sudo mv /usr/share/X11/xorg.conf.d/* ~/backup/ cd /usr/share/X11/xorg.conf.d/ (you can issue an ls here to make sure the dir is empty if you like) sudo wget http://craigerrington.com/chrome/x_alarm_chrubuntu.zip sudo unzip x_alarm_chrubuntu.zip sudo rm x_alarm_chrubuntu.zip
NOTE: This will set up a UK keyboard, follow these simple steps to change it:
Example:
sudo vi /usr/share/X11/xorg.conf.d/10-keyboard.conf
reboot
Ubuntu file system becomes read only
My Ubuntu on Chromebook has this problem, and it fixed by $fsck -Af
Source Link is:
http://askubuntu.com/questions/197459/read-only-file-system
Source Link is:
http://askubuntu.com/questions/197459/read-only-file-system
The filesystem will usually go into read-only while the system is running if there is a filesystem consistency issue. This is specified in
fstab as errors=remount-ro and will occur when a FS access fails or an emergency read-only remount is requested via Alt+SysRq+U. You can run:sudo fsck -Af
to force a check of all filesystems. As the other very good answer states, looking at
dmesg is also very helpful.Friday, June 7, 2013
Capture The Flag notes
Here are some notes for capture the flag:
1. Use backtrack, because it has been installed many attacking tools including Metasploit
2. Use nmap to scan a target host, and identify what services are running
$ nmap -A -T4 www.hostIP.com
-A: Enable OS detection, version detection, script scanning, and traceroute
1. Use backtrack, because it has been installed many attacking tools including Metasploit
2. Use nmap to scan a target host, and identify what services are running
$ nmap -A -T4 www.hostIP.com
-A: Enable OS detection, version detection, script scanning, and traceroute
-T4 for faster execution
nmap cheatsheet: https://tiw2013.cse.psu.edu/slides/cheat_sheet.pdf
3. Go to securityfocus website, use the service name and version as the keyword, then find out if there is an vulnerability for that service.
securityfocus: http://www.securityfocus.com/vulnerabilities
e.g., vsftpd, irc2
4. Open Metasploit to exploit the vulnerability
$ msfconsole
$ use /unix/vsftpd/exploit-path
$ set rhost target-IP
$ exploit
Metasploit set lhost to current IP and payload to reverse-shell as default.
Additional Tips:
1) try rlogin and rsh commands
$ rlogin -l username Target-IP
$ rsh -l username Target-IP
2) take a look at port 1524. If it is open, try to login with netcat
$nc TargetIP 1524
Subscribe to:
Posts (Atom)