Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-04-04 06:11:40
Point:500 Replies:6 POST_ID:828580USER_ID:11059
Topic:
PHP Scripting Language;Apache Web Server;Linux
I got one VPS account in my hosting company from which I am able to
enable and disable my server such as, shutdown, reboot , statup function.
At the beginning, when I tried to change my default root directory from
root to my expected directoy like /home/duncan/public_html by eding
the /etc/passwd with chainging as follows
root:x:0:0:root:/root:/bin/bash to root:x:0:0:root:/root:cd /home/dunican/public_html
and reboot the server, after then, I could not access SSH and my account again , Why ?
All reboot, reset password, shutdow, startup VPS is on the hosting comany member area only on its hosting company website only. I only acess my root account through SSH/putty
But now after passwd file editing, I could not access SSH anymore.
How can I access my SSH again, please advise
Duncan
enable and disable my server such as, shutdown, reboot , statup function.
At the beginning, when I tried to change my default root directory from
root to my expected directoy like /home/duncan/public_html by eding
the /etc/passwd with chainging as follows
root:x:0:0:root:/root:/bin/bash to root:x:0:0:root:/root:cd /home/dunican/public_html
and reboot the server, after then, I could not access SSH and my account again , Why ?
All reboot, reset password, shutdow, startup VPS is on the hosting comany member area only on its hosting company website only. I only acess my root account through SSH/putty
But now after passwd file editing, I could not access SSH anymore.
How can I access my SSH again, please advise
Duncan
Expert: modus_operandi replied at 2024-04-05 18:33:28
Forced accept.
modus_operandi
EE Admin
modus_operandi
EE Admin
Expert: woolmilkporc replied at 2024-04-04 06:51:40
Your hosting company did exactly what I suggested to ask them to do.
See my last comment #a39047503!
So this comment #a39047503 should indeed be accepted as the solution instead of your comment #a39047484 which is in fact a question and not an answer.
See my last comment #a39047503!
So this comment #a39047503 should indeed be accepted as the solution instead of your comment #a39047484 which is in fact a question and not an answer.
Author: duncanb7 replied at 2024-04-04 06:41:53
I've requested that this question be closed as follows:
Accepted answer: 0 points for duncanb7's comment #a39047484
for the following reason:
my hosting company helped to fix it by get the back the original passwd by its SUper access into my server . Now it is back to normal
Accepted answer: 0 points for duncanb7's comment #a39047484
for the following reason:
my hosting company helped to fix it by get the back the original passwd by its SUper access into my server . Now it is back to normal
Accepted Solution
Expert: woolmilkporc replied at 2024-04-04 06:39:37
500 points EXCELLENT
Can you do this ?
ssh otheruser@vps_server
where "otheruser" is a userid other than root? You can then try "sudo" or "su".
If anything fails you'll have to ask the hosting company to reset the /etc/passwd file to some previous version, or to change the "root" entry to contain a valid shell in the last column.
ssh otheruser@vps_server
where "otheruser" is a userid other than root? You can then try "sudo" or "su".
If anything fails you'll have to ask the hosting company to reset the /etc/passwd file to some previous version, or to change the "root" entry to contain a valid shell in the last column.
Author: duncanb7 replied at 2024-04-04 06:33:57
I could not run sudo command since I could not access SSH or putty
What should I ask my hosting company to do for me ?
What should I ask my hosting company to do for me ?
Expert: woolmilkporc replied at 2024-04-04 06:17:28
The last column in /etc/passwd only accepts programs configured in /etc/shells.
Moreover, it may not contain command line parameters, i.e. it must be a contiguous path pointing to an allowed executable (shell).
Better add the "cd" command to one of your initialization files, like ~/.bash_profile, ~/.bash_login or ~/.profile.
If you can use sudo from an admin userid other than root do so to change the passwd file back, or if you know the root password you could also try to "su" (not "su -") to root to perform the change.
Moreover, it may not contain command line parameters, i.e. it must be a contiguous path pointing to an allowed executable (shell).
Better add the "cd" command to one of your initialization files, like ~/.bash_profile, ~/.bash_login or ~/.profile.
If you can use sudo from an admin userid other than root do so to change the passwd file back, or if you know the root password you could also try to "su" (not "su -") to root to perform the change.