banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Mất pass root server - nhờ datacenter reset nhưng không được  XML
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 24/10/2012 23:05:59 (+0700) | #1 | 270412
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]
Chiều nay, khoảng 3h chiều, mình nhận được tin báo là không vào được website của bên minnhf, mình vào kiểm tra thì thấy service mysqld trên server không hoạt động. Mình đang ở trường bị chặn proxy, nên teamviewer vào một máy bạn trong team, sử dụng bitvise ssh và sftp để load về file /var/log/mysqld.log, đọc thấy 4 dòng cuối báo cant not open mysql.sock, mình chưa fix gì hết thì thấy một bạn trong team đã báo lại là chạy bt. Bên mình không can thiệp gì vào.

Khoảng 6h tối nay, mình phải add thêm 1 user ftp cho một bạn coder php, mình chỉ thực hiện các thao tác sau

1. Log vào ssh.
2. useradd username
3. chown username -R /home/website.username/

Sau đó bạn coder báo lại là ftp defaut vào folder /home/username( do khi useradd thì tự động gán trực tiếp vào folder này )
mình dùng sftp của bitvise load file /etc/passwd về, sửa dòng cuối cùng từ

usernamesmilie:505:506::/home/username:/bin/bash
Thành
usernamesmilie:505:506::/home/website.username:/bin/bash

sau đó thì upload lên server ( chép đè lên file cũ )

Sau khi upload lên thì gặp phải tinh trạng là không thể connect được với user username
Mình đã thử change pass rất nhiều lần bằng cách

4. passwd username

=> báo successful, nhưng mình thử connect bằng ftp vẫn không được.

Mình bỏ qua, tạo user ftp khác là website.username cho bạn coder kia làm việc, vì thời gian hơi gấp.


5. useradd website.username
6. chown đúng folder mình cần
7. passwd để set pass cho user này.

Sau đó thì login thử trên cuteftp client. Mọi thứ ok, Mình log out ssh rồi tắt máy.

Đến tối, khi mình connect lại thì không thể đc vì báo sai pass.


Mình có liên hệ với data center, thông báo về sự cố này. Họ trả lời như sau

Sau khi reset lại password như anh yêu cầu thì mình thử login trực tiếp trên màn hình console, màn hình báo login thành công nhưng ngay sau đó màn hình quay trở lại màn hình login, bên mình thử login tiếp tục nhưng tình trạng vẫn như cũ, vậy phiền anh sắp xếp thời gian quan DC để trực tiếp kiểm tra lại tình trạng server nhé. 

Datacenter đặt ở TPHCM, mình ở HN nên không thể vô kiểm tra trực tiếp đc. Hiện tại mình muốn hỏi có bạn nào đã gặp tình trạng ntn chưa, và hướng khắc phục ra sao.

//Hiện tại bên DC đã gắn KVM vào máy, mình vào được single user mode của centos.

Đã thử passwd root, change pass về pass của mình, sau đó reboot server, ra màn hình đăng nhập, gõ đúng user + pass vẫn báo login incorrect..
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 06:41:28 (+0700) | #2 | 270413
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]




Đây là log security của server. Cứ ngay sau khi login thành công, 1 session được tạo ra thì session đó ngay lập tức bị closed.
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 08:11:03 (+0700) | #3 | 270416
traunui
Member

[Minus]    0    [Plus]
Joined: 28/02/2012 20:23:08
Messages: 62
Offline
[Profile] [PM]
Trên server hay CentOS thì mình ko rõ. Nhưng với Ubuntu Desktop mà login cứ bị out ra ngoài vậy thì vào check /home có bị full ko.
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 08:23:23 (+0700) | #4 | 270417
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]
Mình vừa mới chuyển sang server này khoảng 2 tuần, tổng data chưa tới 8gb nên không nghĩ tới trường hợp là /home/ bị full.

Đây là caption màn hình khi đăng nhập ( Chỉ nháy lên cái thông báo bên dưới, sau đó là lại hỏi đăng nhập tiếp )


Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 11:16:01 (+0700) | #5 | 270430
myquartz
Member

[Minus]    0    [Plus]
Joined: 04/01/2005 04:58:30
Messages: 563
Offline
[Profile] [PM]
Shell file bị sai hoặc bi xóa.
Vào single mode rồi gõ lệnh này xem:

usermod --shell /bin/bash root
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 12:43:12 (+0700) | #6 | 270433
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]

usermod --shell /bin/bash root

Đã chạy lệnh trên, không có out put. reboot vào normal mode login vẫn vậy...
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 13:09:38 (+0700) | #7 | 270435
[Avatar]
hoanglan87
Member

[Minus]    0    [Plus]
Joined: 25/06/2008 07:20:09
Messages: 33
Offline
[Profile] [PM]
Mình nghĩ do bạn sửa file /etc/passwd bằng tay nên nó bị lỗi, đối với desktop thì boot bằng live CD sau đó chroot và undo thay đổi trên file passwd. Còn trên server bạn có thể nhờ supporter bên đó giúp đỡ.
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 13:58:33 (+0700) | #8 | 270439
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]

hoanglan87 wrote:
Mình nghĩ do bạn sửa file /etc/passwd bằng tay nên nó bị lỗi, đối với desktop thì boot bằng live CD sau đó chroot và undo thay đổi trên file passwd. Còn trên server bạn có thể nhờ supporter bên đó giúp đỡ. 


Cậu kĩ thuật bên kia báo là em chưa gặp lỗi này bao giờ, gợi ý tháo 1 ổ ( cắm raid 1 ) ra, cài lại OS lên ổ còng lại rồi cắm vào và tính phí 1 củ ...

Mình muốn hỏi mọi người xem có giải pháp khác không smilie
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 21:43:55 (+0700) | #9 | 270459
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
1. FTP không nên dùng 'real' user, có /bin/bash đàng hoàng thế kia.

2. Hiện tượng "gõ password xong, enter, lại quay về màn hình login" trước đây mình có gặp rồi (Fedora, CentOS). Gần đây thấy một bạn dùng Arch cũng bị. Nguyên nhân có thể do PAM.

3.
"unix_chkpwd: password check failed for user (root)" 

Code:
ls -l /sbin/unix_chkpwd


4.
pam_unix(runuser:session): session opened for user qpidd by (uid=0)
pam_unix(runuser:session): session closed for user qpidd
 

Code:
cat /etc/pam.d/login
cat /etc/pam.d/sshd
cat /etc/pam.d/system-auth


5.
login: no shell: No such file or directory 

Kiểm tra xem shell của root đang là gì?
Code:
getent passwd root

và nó còn tồn tại hay không.

Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 25/10/2012 22:59:26 (+0700) | #10 | 270463
dungnguyen31
Member

[Minus]    0    [Plus]
Joined: 27/07/2007 11:29:48
Messages: 7
Offline
[Profile] [PM]
Mình hiện đang cùng quản trị server với mr.tee. mình đã chạy các lệnh của bạn và out put cho ra như này

quanta wrote:

ls -l /sbin/unix_chkpwd
 

Code:
-rwsr-xr-x. 1 root root 34840 Apr 16 2012 /sbin/unix_chkpwd



cat /etc/pam.d/login
 






cat /etc/pam.d/sshd
 






cat /etc/pam.d/system-auth
 





Kiểm tra xem shell của root đang là gì?
Code:
getent passwd root

 


output:
Code:
root: x:0:0:root:/root:bin/bash
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 07:57:04 (+0700) | #11 | 270469
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]

dungnguyen31 wrote:


Kiểm tra xem shell của root đang là gì?
Code:
getent passwd root

 


output:
Code:
root: x:0:0:root:/root:bin/bash
 


Mình mới thử boot vào single user mode, thử cat /bin/bash vẫn thấy có nội dung file, nên chắc là file ấy vẫn tồn tại.
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 08:24:41 (+0700) | #12 | 270470
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Bạn thử login với một user có uid khác 0 chưa? Nếu rồi, thì có được không? Thảy đoạn log trong `/var/log/secure` lúc login lên đây.

Tiện tay, cho mình xem luôn `/etc/ssh/sshd_config` nhé.

mr.tee wrote:

Mình mới thử boot vào single user mode, thử cat /bin/bash vẫn thấy có nội dung file, nên chắc là file ấy vẫn tồn tại. 

Đừng `cat`, chỉ cần `file /bin/bash` là được rồi.

PS: mấy cái screenshots ở trên bạn làm thế nào mà chụp được vậy?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 09:22:06 (+0700) | #13 | 270473
traunui
Member

[Minus]    0    [Plus]
Joined: 28/02/2012 20:23:08
Messages: 62
Offline
[Profile] [PM]
Ở trên có đoạn này bác ah

//Hiện tại bên DC đã gắn KVM vào máy, mình vào được single user mode của centos.
 


Nhưng em cũng không biết nó là cái gì
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 09:40:07 (+0700) | #14 | 270474
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

traunui wrote:
Ở trên có đoạn này bác ah

//Hiện tại bên DC đã gắn KVM vào máy, mình vào được single user mode của centos.
 

 

À, mình đọc sót mất.

traunui wrote:

Nhưng em cũng không biết nó là cái gì  

http://www.cyberciti.biz/tips/kvm-over-ip.html
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 11:27:44 (+0700) | #15 | 270477
dungnguyen31
Member

[Minus]    0    [Plus]
Joined: 27/07/2007 11:29:48
Messages: 7
Offline
[Profile] [PM]

quanta wrote:
Bạn thử login với một user có uid khác 0 chưa? Nếu rồi, thì có được không? Thảy đoạn log trong `/var/log/secure` lúc login lên đây.

Tiện tay, cho mình xem luôn `/etc/ssh/sshd_config` nhé.

mr.tee wrote:

Mình mới thử boot vào single user mode, thử cat /bin/bash vẫn thấy có nội dung file, nên chắc là file ấy vẫn tồn tại. 

Đừng `cat`, chỉ cần `file /bin/bash` là được rồi.

PS: mấy cái screenshots ở trên bạn làm thế nào mà chụp được vậy? 


khi mình login vào 1 user khác 0 thì kết quả vẫn vậy và quay lại màn hình login.

đây là file /var/log/secure




đây là file /etc/ssh/sshd_config

Code:
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile	.ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
#KerberosUseKuserok yes

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem	sftp	/usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	ForceCommand cvs server


Còn chụp screenshot là do bên DC cắm kvm và mình chỉ login vào bằng http

[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 11:55:22 (+0700) | #16 | 270478
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]



Em thắc mắc 1 tẹo, đấy là cái đoạn session opened for user hanoistory by LOGIN (uid=0)

uid của hanoistory chắc chắn là một số # 0, vậy cái đoạn uid=0 ở đây là lỗi ?
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 13:58:25 (+0700) | #17 | 270483
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

login: pam_unix(login:session): session opened for user hanoistory by LOGIN(uid=0)
login: LOGIN ON tty1 BY hanoistory
login: pam_unix(login:session): session closed for user hanoistory
 

Liệu có cái `exit` nào trong `/etc/profile` không nhỉ? Giờ bạn còn gặp lỗi "login: no shell: No such file or directory" không? Nếu còn, sao mình không thấy thông tin liên quan trong `/var/log/secure` nhỉ? Thử dùng một cái shell khác trong `/etc/shells` xem chuyện gì xảy ra.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 14:28:53 (+0700) | #18 | 270485
dungnguyen31
Member

[Minus]    0    [Plus]
Joined: 27/07/2007 11:29:48
Messages: 7
Offline
[Profile] [PM]
nó vẫn có lỗi báo "login: no shell: No such file or directory". nhưng hiện giờ bên đó đã rút kvm ra, chắc phải bảo bên DC cài lại vây.
Thanks mod
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 14:49:14 (+0700) | #19 | 270486
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

dungnguyen31 wrote:
nó vẫn có lỗi báo "login: no shell: No such file or directory".
 

Vậy cứ thử một cái shell khác đi.

dungnguyen31 wrote:

nhưng hiện giờ bên đó đã rút kvm ra, chắc phải bảo bên DC cài lại vây.
 

Bạn không nhờ họ cắm lại được à? Cài lại chỉ là giải pháp cuối cùng thôi.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 15:36:33 (+0700) | #20 | 270488
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]
bên DC đã cắm lại rồi.
Em đang boot vào single user mode để thử change sang shell khác. Có gì em sẽ post lên ngay.
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 16:18:23 (+0700) | #21 | 270491
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]
Cảm ơn anh quanta và các bạn, em đã change về /bin/sh, ok rồi.



Như thế này là do shell /bin/bash của server bên em bị corrupt phải không ạ ?
Cho em hỏi thêm là các shell như /bin/bash, /bin/sh, /bin/csh có khác biệt gì nhau không, và nếu không thì tại sao trên server lại có nhiều shell, sử dụng chung 1 mục đích như vậy ạ

Em cảm ơn.
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 21:07:42 (+0700) | #22 | 270504
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

mr.tee wrote:
Cảm ơn anh quanta và các bạn, em đã change về /bin/sh, ok rồi.


 

Quái! Mặc định thì `/bin/sh` là symlink của `/bin/bash` mà.
Code:
ls -l /bin/sh 
lrwxrwxrwx 1 root root 4 Apr 22  2010 /bin/sh -> bash

mr.tee wrote:

Như thế này là do shell /bin/bash của server bên em bị corrupt phải không ạ ?
 

Ơ, có khi mình đoán được nguyên nhân rồi. Giờ bạn chạy `chsh -s /bin/bash`, logout rồi thử login lại xem, mình đồ rằng lại ngon.

mr.tee wrote:

Cho em hỏi thêm là các shell như /bin/bash, /bin/sh, /bin/csh có khác biệt gì nhau không 

Có. Bạn thử tìm hiểu xem.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 21:14:18 (+0700) | #23 | 270505
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]

quanta wrote:

Ơ, có khi mình đoán được nguyên nhân rồi. Giờ bạn chạy `chsh -s /bin/bash`, logout rồi thử login lại xem, mình đồ rằng lại ngon.
 


Code:
#chsh -s /bin/bash username


Code:
Last login: Sat Oct 27 05:11:21 2012 from 171.225.106.115
[username@localhost ~]$


Lần này thì lại được. Nguyên nhân ở đâu vậy anh smilie
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 21:20:26 (+0700) | #24 | 270507
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

mr.tee wrote:

Code:
#chsh -s /bin/bash username


Code:
Last login: Sat Oct 27 05:11:21 2012 from 171.225.106.115
[username@localhost ~]$

Lần này thì lại được.
 

Bạn tạo account `username` như nào?

mr.tee wrote:

Nguyên nhân ở đâu vậy anh smilie 

Cái này bí hiểm lắm. Chắc phải Cafe mới nói được smilie.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 21:45:53 (+0700) | #25 | 270509
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]

quanta wrote:

Bạn tạo account `username` như nào?
 


Account username là account từ trước của em, tạo để chạy một site nhỏ trên server. Em cứ

Code:
#useradd username
#chown username -R /home/username/

quanta wrote:

Cái này bí hiểm lắm. Chắc phải Cafe mới nói được :">
 

A ở Hà Nội là em điều 1 em chân dài tới bẹn cafe với anh ngay ạ smilie
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 22:00:35 (+0700) | #26 | 270510
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

mr.tee wrote:
Account username là account từ trước của em, tạo để chạy một site nhỏ trên server. Em cứ

Code:
#useradd username
#chown username -R /home/username/

 

Gần đây, có ai mở `/etc/passwd` ra chỉnh chọt gì không?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 22:04:46 (+0700) | #27 | 270511
mr.tee
Member

[Minus]    0    [Plus]
Joined: 20/10/2009 01:18:07
Messages: 58
Offline
[Profile] [PM]
có em ạ.
Thường ngày thì em tải về, mở bằng notepad++ để chỉnh rồi up lên bình thường, không thấy vấn đề gì smilie
Hôm đó ngồi máy của bạn, mở đại bằng wordpad rồi táng, sau đó upload lên.
Après la pluie, le beau temps
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 26/10/2012 22:13:32 (+0700) | #28 | 270512
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

mr.tee wrote:
có em ạ.
Thường ngày thì em tải về, mở bằng notepad++ để chỉnh rồi up lên bình thường, không thấy vấn đề gì smilie
Hôm đó ngồi máy của bạn, mở đại bằng wordpad rồi táng, sau đó upload lên.
 

Hì, nguyên nhân là đây chứ đâu.

Muốn thay đổi thông tin liên quan đến user thì có `usermod` rồi. Muốn đổi shell thì dùng `chsh`. Không nên mở trực tiếp `/etc/passwd` để chỉnh sửa.

Bạn đọc tạm cái này nhé: http://en.wikipedia.org/wiki/Newline
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 27/10/2012 00:21:17 (+0700) | #29 | 270513
[Avatar]
xnohat
Moderator

Joined: 30/01/2005 13:59:19
Messages: 1210
Location: /dev/null
Offline
[Profile] [PM] [Email] [WWW] [Yahoo!] [MSN]

quanta wrote:

mr.tee wrote:
có em ạ.
Thường ngày thì em tải về, mở bằng notepad++ để chỉnh rồi up lên bình thường, không thấy vấn đề gì smilie
Hôm đó ngồi máy của bạn, mở đại bằng wordpad rồi táng, sau đó upload lên.
 

Hì, nguyên nhân là đây chứ đâu.

Muốn thay đổi thông tin liên quan đến user thì có `usermod` rồi. Muốn đổi shell thì dùng `chsh`. Không nên mở trực tiếp `/etc/passwd` để chỉnh sửa.

Bạn đọc tạm cái này nhé: http://en.wikipedia.org/wiki/Newline
 


Tối nay vô mới thấy topic này

Lỗi này mình cũng gặp 1 lần, và tình trạng y chang như bồ mr.tee bị, lỗi do tải file /etc/passwd về một máy windows để chỉnh sửa và save lại, nguyên do là newline khác biệt giữa windows và *nix, windows dùng \r\n thay vì chỉ \n như trên *nix, cơ mà mình bị khác 1 chút do mình đã kĩ tính find & replace hết vụ newline do thói quen, mình bị dính lỗi khi save file với format UTF-8 with BOM ( dùng Notepad++ để chỉnh sửa ) smilie note ra cho anh em nào bị lỗi trên thì tham khảo biết mà sửa
iJust clear, "What I need to do and how to do it"/i
br
brBox tán gẫu dời về: http://www.facebook.com/hvaonline
[Up] [Print Copy]
  [Question]   Mất pass root server - nhờ datacenter reset nhưng không được 27/10/2012 14:45:48 (+0700) | #30 | 270522
[Avatar]
Ikut3
Elite Member

[Minus]    0    [Plus]
Joined: 24/09/2007 23:47:03
Messages: 1429
Location: Nhà hát lớn
Offline
[Profile] [PM] [Yahoo!]
Hô hô hoá ra tay Tee không có biết dùng vi / nano :">
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|