longhtml | SSH命令 | 2011/07/19常用的Liunx命令(SSH客户端自己用的)
cd /usr/local/tomcat/bin //切换目录
su root //切换用户
startup.sh //启动tomcat
./shutdown.sh //关闭tomcat
kill -9 进程号 //结束进程
tar -zcvf /tmp/etc.tar.gz /etc //解压缩
chmod -R 777 /usr/local/tomcat/webapps/ROOT/ //改变文件夹权限
chown -R lifunet /usr/local/tomcat/webapps/ //赋给用户上传权限
mysql -u用户名 -p密码 数据库 //进入mysql
例如:mysql -uroot -p1234 029wo.cn
安装文件的一般操作
1. 解包:
tar xzvf httpd-2.2.0.tar.gz
操作文件
一般用vi打开
vi /路径/文件名
完了之后, 退出insert 点击Insert :wq 回车,就保存了。
刚进入文件只能浏览不能修改 想修改按 i
删除一个字母用x 删除一行 用 dd
继续浏览点击 Esc
退出 shift+: wq
就ok
查看进程的命令有很多,这里只是列出了我最常用的几个。
netstat –tln //查看服务监听端口
netstat //查看进程号
ps –aux //查看进程号
ps –aux | more //全部查看
ps –ef | grep mysql //查看mysql的进程
kill -9 3306 //强制杀掉进程号3306
防火墙的设置
设置防火墙: setup
查看防火墙设置: iptables –L
关闭防火墙: iptables -F
1) 永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。
在开启了防火墙时,做如下设置,开启相关端口,
修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
1. man 对你熟悉或不熟悉的命令提供帮助解释eg:man ls 就可以查看ls相关的用法
2. ls 查看目录或者文件
3. cp 拷贝文件
4. rm 删除文件和目录
5. mv 移走目录或者改文件名
6. cd 改变当前目录 pwd 查看当前所在目录完整路径
7. cat,more命令将某个文件的内容显示出来。
8.chmod 命令 权限修改 用法:chmod 一位8进制数 filename。
9. clear,date命令:clear:清屏,相当与DOS下的cls;date:显示当前时间。
10. mount 加载一个硬件设备
11. su 在不退出登陆的情况下,切换到另外一个人的身份
12.who am i,where is,which,id
//whoami:确认自己身份
//whereis:查询命令所在目录以及帮助文档所在目录
//which:查询该命令所在目录(类似whereis)
//id:打印出自己的UID以及GID。(UID:用户身份唯一标识。GID:用户组身份唯一标识。每一个用户只能有一个唯一的UID和 GID)
13. grep,find
grep:文本内容搜索;find:文件或者目录名以及权限属主等匹配搜索
eg: grep success * /*查找当前目录下面所有文件里面含有success字符的文件
14. kill 可以杀死某个正在进行或者已经是dest状态的进程
15. passwd 可以设置口令
16. history 用户用过的命令
17. !! 执行最近一次的命令
18. mkdir命令
19. tar 解压命令
20. finger 可以让使用者查询一些其他使用者的资料
文件从命名:
mv 原来的名字 现在的名字
#zip -r 打包的名字 /目标文件夹
例如: #zip -r 029wo.zip /usr/local/tomcat/webapps/*
解压zip包 unzip 文件名
例如: unzip 029wo.zip
longhtml | SSH基础 | SSH (Secure Shell)
SSH (Secure Shell) is a protocol for creating a secure connection between two computers.
The secure SSH connection provides authentication and encryption. SSH also provides compression.
The SSH protocol is defined by the IETF Secure Shell Working Group(secsh).
SSH was designed as a replacement for the legacy `telnet` application.
The computer being connected to must be running an ssh daemon, or server, process.
The computer which is attempting to connect must be running an SSH client.
SCP and SFTP – Secure File Transfer Using SSH
SCP and SFTP are replacements for the legacy `cp` and `ftp` file transfer applications.
SCP and SFTP enable secure encrypted file transfer over an SSH connection.
Free SSH Servers
There are several free SSH implementations available. Some support only SSH, while others also support SCP and SFTP.
| SSH Server | Operating Systems Supported |
|---|---|
| OpenSSH | AIX, HP-UX, Irix, Linux, NeXT, SCO, SNI/Reliant Unix, Solaris, Digital Unix/Tru64/OSF, Mac OS X, and Cygwin |
| Dropbear SSH Server | Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Solaris, Irix, True64, AIX, HP-UX |
| FreeSSH | NetBSD, FreeBSD, Linux |
| lsh | GNU/Linux on Sparc, Intel, PPC and Alpha, FreeBSD, Solaris and IRIX |
| SSHD-NT | Windows |
| OpenSSH for Windows | Windows |
Free SSH Clients
| SSH Client | Operating Systems Supported |
|---|---|
| OpenSSH | AIX, HP-UX, Irix, Linux, NeXT, SCO, SNI/Reliant Unix, Solaris, Digital Unix/Tru64/OSF, Mac OS X, and Cygwin |
| FreSSH | NetBSD, FreeBSD, Linux |
| lsh | GNU/Linux on Sparc, Intel, PPC and Alpha, FreeBSD, Solaris and IRIX |
| OpenSSH for Windows | Windows |
| PuTTY | Win32 and Unix |
| MSSH | Windows |
| WinSCP | Windows (SCP and SFTP, no SSH) |
| Fugu | Macintosh |
| MacSSH | Macintosh |
| Cyberduck | Macintosh (SFTP only) |
| pssh | Palm OS |
| TuSSH | Palm OS |
Note: I have specifically excluded SSH clients and servers which do not support the SSH v2 protocol.
For more information on SSH, read the SSH FAQ.
SSH代理教程 – SSH代理,SSH账号
longhtml | SSH基础 | ssh是什么
SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Working Group)所制定;SSH 为建立在应用层和传输层基础上的安全协议。SSH 是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题。S S H最初是U N I X系统上的一个程序,后来又迅速扩展到其他操作平台。S S H在正确使用时可弥补网络中的漏洞。S S H客户端适用于多种平台。几乎所有U N I X平台—包括H P – U X、L i n u x、A I X、S o l a r i s、Digital UNIX、I r i x,以及其他平台—都可运行S S H。