xp底下成功使用ssh登录ubuntu linux(采用密钥方式)
服务器端的设置:
安装ssh:
sudo apt-get install ssh
以普通用户的身份建立公钥和私钥:
ssh-keygen -t rsa
然后要求你确认钥匙的文件名(用默认的就好了);输入口令;再次输入口令。
在~/.ssh/下会生成公钥id_rsa.pub和私钥id_rsa
更改公钥文件名:
cd ~/.ssh/
mv id_rsa.pub authorized_keys
设置文件属性:
chmod 400 authorized_keys
chmod 644 id_rsa
备份SSH服务的配置文件
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIGINAL
编辑配置文件
sudo gedit /etc/ssh/sshd_config
这是我的配置文件,重点部分我会用红色字体,注释用蓝色字体
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024 //将ServerKey强度改为1024比特
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin no //禁止以root登录
StrictModes no //关闭严格登录
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile /home/yourusername/.ssh/authorized_keys //这里是指定你公匙所在的位置,yourusername用你的用户名代替。
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes
相关文档:
linux 下安装oracle 是一件很令人头疼的事情,我把自己的安装步骤拿出来给大家分享一下。
一.linux服务端的安装.
1.下载oracle服务端软件,下载网址如下
http://www.oracle.com/technology/software/products/database/index.html
我选择的版本是:Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86-64
......
1. 查找Java项目中,main方法定义在哪个文件里.
切换到你要查找项目的目录下执行
grep -rlI '\
如果你觉得自己打字快,不怕麻烦执行如下命令也可以找到该文件
find -type f -name *.java -exec grep -l '\
2 快速的建立一个文件,并输入一些内容
cat >> filename ,输入一些内容然 ......
已经某个端口号被占用,如何根据端口号得到占用它的进程的ID呢
用lsof
,lsof在ubuntu下的安装命令为apt-get install lsof
若已知端口号为15000,则对应查找命令为lsof -i | grep 15000
本机显示结果为:
host 3386
trinea 4u IPv4 16907 & ......
http://blog.chinaunix.net/u1/51797/showart_1019166.html
Taglist
Taglist是一个vim的源代码浏览插件,具体功能介绍还烦请各位看官自己google一下。很多事情还需要亲身经历才有用,别人代劳是不行的。
需要安装这个插件,插件下载地址:Taglist下载地址
http://www.vim.org/scripts/script.php?script_id=273
里面有 ......