Problem Linux 輸入 password 正確,但卻無法 login,系統顯示 Access Denied Study 此現象由於 User 輸入錯誤密碼超過限定次數,而帳號被鎖定。 Solution 參考[1] 的解決方式如下: [srv ~]# faillog -u test Login Failures Maximum Latest On test 16 0 06/23/15 11:23:12 +0800 srv-q00-12 [srv ~]# /usr/bin/faillog -r test [srv ~]# faillog -u test Login Failures Maximum Latest On test 0 0 06/23/15 11:27:15 +0800 srv-q00-11 參考 1. Linux denying user access after reseting password, http://setaoffice.com/2010/04/08/linux-denying-user-access-after-reseting-password/
“Those who are in love with practice without knowledge are like the sailor who gets into a ship without rudder or compass and who never can be certain [where] he is going. Practice must always be founded on sound theory.” by Leonardo da Vinci
2015年6月22日 星期一
【Linux 】password 正確,但卻無法 login
2015年6月3日 星期三
【Linux 】ssh_exchange_identification: Connection closed by remote host lost connection
Problem 欲將在主機A上的檔案以scp 傳送至另外一台主機B,無法連線,而系統顯示錯誤訊息: ssh_exchange_identification: Connection closed by remote host lost connection Solution 1. 檢查兩台主機的 /etc/hosts 是否正確 2. 參考[1],按步驟做檢查兩邊的設定,而找出解決方法。例如: 在主機A,有定義主機B的IP位置: [A]# grep sshd /etc/hosts.allow sshd:100.1.38.1 但是檢查主機 B 時,卻發現 /etc/hosts.allow 中沒有設定主機 A 的 IP 位置,此時只要以 vi 指令將主機 A 的 IP 加入即可。 Validation [A]# scp test.txt root@100.1.38.1:/ddd/ root@100.1.38.1's password: test.txt 100% 5 0.0KB/s 00:00 Reference 1. ssh_exchange_identification: Connection closed by remote host, http://edoceo.com/notabene/ssh-exchange-identification
2014年10月22日 星期三
【Linux 筆記 】下載 Oracle Patch 前,確認 Linux 32 或 64 版本
有 3 種方法可確認 Linux 是 32 位元,或是64位元的版本: 1. 使用 uname 指令 2. 使用 file 指令 3. 使用 getconf 指令 例如,參考下面範例: 1. 使用 uname 指令 [test@tw-srv-erp bin]$ uname -a Linux tw-srv-erp.elvismeng.com.tw 2.6.18-53.el5 #1 SMP Sat Nov 10 19:37:22 EST 2007 x86_64 x86_64 x86_64 GNU/Linux 2. 使用 file 指令 [test@tw-srv-erp bin]$ file /bin/bash /bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped 3. 使用 getconf 指令 [test@tw-srv-erp bin]$ getconf LONG_BIT #64bits 64 [test@tw-srv-erp bin]$ getconf LONG_BIT #32bits 64
2014年10月21日 星期二
【Linux 筆記 】root 密碼修改
考慮資安,定期更改伺服器 / 個人 帳號是必須的,而在 Linux 更改 root 的密碼,與更改一般 user 的密碼方式相同,即是下 passwd accountName 來更改。例如:
[root@localhost etc]# passwd root
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost etc]#
一般公司擁有多伺服器,所以不同主機會設定不同的密碼,此時密碼的安全控管很重要。在密碼管理上已有相當多的工具可選用,例如 KeyPass 等工具也相當好用。
【Linux 筆記 】如何更改 Linux 的 hostname 設定
Red Hat Linux 安裝完後,下指令 # hostname 時,會顯示:[root@localhost ~]# hostname localhost.localdomain
而查看 /etc/hostname 時,系統顯示:[root@localhost ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6
我們將 /etc/hosts 這檔案修改為:[root@localhost etc]# vi hosts # Do not remove the following line, or various programs # that require network functionality will fail. #127.0.0.1 localhost.localdomain localhost #::1 localhost6.localdomain6 localhost6 127.0.0.1 tw-srv-erp.elvismeng.com.tw tw-srv-erp 172.20.1.100 tw-srv-erp.elvismeng.com.tw tw-srv-erp 127.0.0.1 localhost
另外,我們還需修改/etc/sysconfig 目錄下的 network 檔案。查看此目錄,顯示目前network 檔案的內容為:[root@localhost sysconfig]# cat network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=localhost.localdomain
現在讓我們修改 /etc/sysconfig/network 這檔案,在修改前,有些設定要先規劃確定: 1. localhost 命名 (例如: tw-srv-erp ) 2. localdomain 命名 (例如: elvismeng.com.tw) 3. GATEWAY 的 ip 配置 GATEWAY 的設定一般先查看伺服器的 ip 位置,例如: 新增 Linux 伺服器的 ip 為 12.2.1.100,那 GATEWAY 設定為 12.2.1.254[root@localhost sysconfig]# vi network NETWORKING=yes NETWORKING_IPV6=no #HOSTNAME=localhost.localdomain HOSTNAME=tw-srv-erp.elvismeng.com.tw GATEWAY=12.2.1.254
雖然 hostname 的設定完成,但還沒有生效,所以須下 hostname 此指令:[root@localhost sysconfig]# hostname tw-srv-erp
最後,我們驗證看 hostname 是否已經被修改成功:[root@localhost sysconfig]# hostname tw-srv-erp
另外,我們也可用 ping hostname 的方式來驗證:[root@localhost sysconfig]# ping tw-srv-erp PING tw-srv-erp.elvismeng.com.tw (127.0.0.1) 56(84) bytes of data. 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=1 ttl=64 time=0.815 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=2 ttl=64 time=0.067 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=3 ttl=64 time=0.066 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=4 ttl=64 time=0.060 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=5 ttl=64 time=0.067 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=6 ttl=64 time=0.068 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=7 ttl=64 time=0.058 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=8 ttl=64 time=0.068 ms ^C64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=9 ttl=64 time=0.065 ms 64 bytes from tw-srv-erp.elvismeng.com.tw (127.0.0.1): icmp_seq=10 ttl=64 time=0.069 ms --- tw-srv-erp.elvismeng.com.tw ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9000ms rtt min/avg/max/mdev = 0.058/0.140/0.815/0.225 ms [root@localhost sysconfig]#
參考 1. How to Change the Hostname of a Linux System http://www.ducea.com/2006/08/07/how-to-change-the-hostname-of-a-linux-system/ 2. 蔡宗融個人網站,http://www.ichiayi.com/wiki/tech/linux_hostname
訂閱:
文章 (Atom)