วันพุธที่ 28 มีนาคม พ.ศ. 2561

command add user and local

Add local account of goat with password of  T@styHay!
net user /add goat T@styHay!
Net User Add
Now add the goat account to the local administrators groupnet localgroup administrators /add goat
Net Localgroup Add
View members of the local administrators group and make sure your new account is there
net localgroup administrators
Net Localgroup Administrators
Once you’re done, it’s polite to delete your account.
net user /delete goat
Net User Delete

Other handy account management

Show all users on the local box
net user
Disable an account
net user goat /active:no
Enable an account
net user goat /active:yes
Change a users password
net user goat T@styAlfalfa!

 ถ้าไม่ได้ลอง Net user test test

(Apply to all accounts)
 wmic UserAccount set PasswordExpires=False

OR

(Apply to specific local account)
 wmic UserAccount where Name="user name" set PasswordExpires=False

วันจันทร์ที่ 26 มีนาคม พ.ศ. 2561

ftp vsftp login incorrect 530 can't login vesta


ftp vsftp login incorrect 530 can't login
Hey there,

I just wanted to share a problem I had with my ftpdaemon with you and which I didn't find in this forum.

My ftp server always throw an error, trying to log in with new created ftp accounts. I'm not sure since when this error occurred, a user of mine pointed me on that issue. But I would say the Vestacp version is not essential in that case.

My ftp client acted as if I just entered wrong user data.
CODE: SELECT ALL
Befehl:       USER ******
Antwort:     331 Please specify the password.
Befehl:       PASS *******
Antwort:     530 Login incorrect.
So I checked the vsftp logs in /var/log/vsftpd.log
CODE: SELECT ALL
Sun Mar 25 12:04:01 2018 [pid 2] CONNECT: Client "87.123.193.139"
Sun Mar 25 12:04:04 2018 [pid 1] [*********] FAIL LOGIN: Client "87.123.193.139"
Actually looked like wrong user data. But I entered them correctly.
I checked /etc/passwd and in the meantime I also googled a bit. So I found this article, which described exactly my problem.
https://github.com/serghey-rodin/vesta/issues/1437

New users got a different path to the "nologin" shell than before.
Initially it was /sbin/nologin. New users got the path to /usr/sbin/nologin
That path was not registered in /etc/shells.
CODE: SELECT ALL
nano /etc/shells
Looked like this:
CODE: SELECT ALL
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/sbin/nologin
/usr/bin/rssh
/usr/bin/tmux
and I easily added this line
CODE: SELECT ALL
/usr/sbin/nologin
saved the file and everything worked fine again afterwards.

Cheers and have a nice Sunday
!


How to start / stop / restart / enable / reload the VSFTPD server in Linux

Systemd is a new init system and system manager which was implemented/adapted into all the major Linux distributions over the traditional SysV init systems due to lots of issue/improvement has to be on sysVinit systems. All the services is available “/etc/init.d/. If you want to start, stop, restart, enable, reload & status of the service follow the below commands to do it. Either root or sudo Permission needed to run the below commands.

1) To Start VSFTPD server

Use the below commands to start the VSFTPD server in Linux.
# For Sysvinit Systems #
# service vsftpd start
or
# /etc/init.d/vsftpd start

# For Systemd Systems #
# systemctl start vsftpd.service
or
# systemctl start vsftpd

2) To Stop VSFTPD server

Use the below commands to stop the VSFTPD server in Linux.
# For Sysvinit Systems #
# service vsftpd stop
or
# /etc/init.d/vsftpd stop

# For Systemd Systems #
# systemctl stop vsftpd.service
or
# systemctl stop vsftpd

3) To Restart VSFTPD server

Use the below commands to restart the VSFTPD server in Linux.
# For Sysvinit Systems #
# service vsftpd restart
or
# /etc/init.d/vsftpd restart

# For Systemd Systems #
# systemctl restart vsftpd.service
or
# systemctl restart vsftpd

4) To Reload VSFTPD server

Use the below commands to reload the VSFTPD server in Linux.
# For Sysvinit Systems #
# service vsftpd reload
or
# /etc/init.d/vsftpd reload

# For Systemd Systems #
# systemctl reload vsftpd.service
or
# systemctl reload vsftpd

5) To view status of VSFTPD server

Use the below commands to view the status of VSFTPD server in Linux.
# For Sysvinit Systems #
# service vsftpd status
or
# /etc/init.d/vsftpd status

# For Systemd Systems #
# systemctl status vsftpd.service
or
# systemctl status vsftpd

6) To Enable VSFTPD server in boot

Use the below commands to enable the VSFTPD server in boot. In sysVinit system we can use Chkconfig command to configure services in boot via /etc/rd.d/init.d script & Systemd system via /usr/lib/systemd/system script.
# For Sysvinit Systems #
# chkconfig vsftpd on

# For Systemd Systems #
# systemctl enable vsftpd.service
or
# systemctl enable vsftpd

วันอาทิตย์ที่ 25 มีนาคม พ.ศ. 2561