最近安装linux环境,由于是简易安装,所以准备部署程序环境了才发现,有些基本命令都无法使用,比如
[root@rac3 network-scripts]# scp
-bash: scp: command not found
开始我还以为是没有配置环境变量,结果并不是,连root用户都没有这个命令,网上查了下资料,少了openssh-clients、在网上下载了许多版本都不靠谱,很不兼容,要报错。算了还是用自己的安装盘,或者iso是最靠谱的。
下面加载光驱获取rpm包。
[root@rac3 ~]# mkdir /mnt/cdrom
[root@rac3 ~]# mount -t auto /dev/cdrom /mnt/cdrom
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@rac3 ~]#
[root@rac3 ~]# cd /mnt/cdrom
[root@rac3 cdrom]# ls
EFI Packages RELEASE-NOTES-gu-IN.html RELEASE-NOTES-or-IN.html RELEASE-NOTES-zh-TW.html
EULA README RELEASE-NOTES-hi-IN.html RELEASE-NOTES-pa-IN.html repodata
GPL RELEASE-NOTES-as-IN.html RELEASE-NOTES-it-IT.html RELEASE-NOTES-pt-BR.html ResilientStorage
HighAvailability RELEASE-NOTES-bn-IN.html RELEASE-NOTES-ja-JP.html RELEASE-NOTES-ru-RU.html RPM-GPG-KEY-redhat-beta
images RELEASE-NOTES-de-DE.html RELEASE-NOTES-kn-IN.html RELEASE-NOTES-si-LK.html RPM-GPG-KEY-redhat-release
isolinux RELEASE-NOTES-en-US.html RELEASE-NOTES-ko-KR.html RELEASE-NOTES-ta-IN.html ScalableFileSystem
LoadBalancer RELEASE-NOTES-es-ES.html RELEASE-NOTES-ml-IN.html RELEASE-NOTES-te-IN.html Server
media.repo RELEASE-NOTES-fr-FR.html RELEASE-NOTES-mr-IN.html RELEASE-NOTES-zh-CN.html TRANS.TBL
[root@rac3 cdrom]# cd Packages/
[root@rac3 Packages]#
[root@rac3 Packages]# rpm -ivh libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm
warning: libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:libedit ########################################### [100%]
[root@rac3 Packages]#
[root@rac3 Packages]# rpm -ivh openssh-clients-5.3p1-81.el6.x86_64.rpm
warning: openssh-clients-5.3p1-81.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:openssh-clients ########################################### [100%]
[root@rac3 Packages]#
--已经安装成功(主要就是安装这两个文件,你的版本可能跟我有所不同)
测试下scp命令,已经存在了
[root@rac3 Packages]# scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
[root@rac3 Packages]#
[root@rac3 Packages]# cd
[root@rac3 ~]# umount /mnt/cdrom
[root@rac3 ~]#