设置IP
假设要将IP设置为192.168.16.2 网关为192.168.16.250
- 设置IP:修改/etc/hosts,/etc/inet/hosts和 /etc/inet/ipnodes这三个文件,内容为192.168.16.2?主机名?loghost
- 设置子网掩码:更改了/etc/netmasks
- 设置缺省网关:添加或者更新文件/etc/defaultrouter,内容为:192.168.16.250
- 设置主机名:添加了文件/etc/nodename 内容为主机名
- 重启网卡,不需要重启系统即可生效:# svcadm disable physical # svcadm enable physical
- 检测IP是否设置成功Ifconfig –a?
启动ssh
注意可能需要root权限,然后在运行命令,重启后需要重新启动ssh
# ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
#/lib/svc/method/sshd start
?
其他常用命令
- 进入bash模式:bash。标准的GNU shell,直观而又灵活。
- 解压缩:unzip
- 查看当前目录:pwd
- 赋予执行权限:chmod +X *.sh