/dev/sda1 was not cleanly unmounted, check forced
10.2% non-contiguous
mountall: fsck /boot [286] terminated with status 1
---
Boot Ubuntu on recovery mode
---
#umount /dev/sda1
#if errors: -y auto answers yes for fixes needing response see man e2fsck
sudo e2fsck -f -y -v /dev/sda1
My status
My backup memory
Hiển thị các bài đăng có nhãn Linux. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Linux. Hiển thị tất cả bài đăng
Thứ Bảy, 23 tháng 8, 2014
Thứ Sáu, 8 tháng 11, 2013
Open SSH cho Buffalo LS-VL WL QVL
Mặc dù hướng dẫn đã có tại http://buffalo.nas-central.org/wiki/Open_Stock_Firmware_LS-VL
nhưng để thực hiện thành công cần lưu ý:
+ Java
cd \
cd C:\Program Files (x86)\Java\jre7\bin
+ Thực hiện acp_commander. Gia thiet IP la 192.168.1.14. Chu y lenh sau tuy chon -c phai nam trong "..." chu khong phai '...'
Kiem tra output co thay 2 file
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /mnt/disk1/share/"
Thuc hien script
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "sh -x /mnt/disk1/share/open-ls.txt"
Vi ly do nao do script khong thuc hien dc => copy sshd_config sang share => chmod 666 de kiem tra, chinh sua ==> copy back to /etc => chmod 600
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /etc/sshd_config /mnt/disk1/share/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 666 /mnt/disk1/share/sshd_config"
Chinh sua PermitRootLogin to "yes" va PermitEmptyPasswords yes
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /mnt/disk1/share/sshd_config"
test OK
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/sshd_config /etc/"
verify ok
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "grep PermitRootLogin /etc/sshd_config"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /etc/sshd_config"
Restart sshd
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "/etc/init.d/sshd.sh restart"
Neu ko dc, thuc hien script thu cong
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /root"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/authorized_keys /root/.ssh/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "mkdir /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 700 /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/authorized_keys /root/.ssh/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /root/.ssh/authorized_keys"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "dos2unix /root/.ssh/authorized_keys"
Note: doi voi LS-VL neu dung fw 1.65mod1/1a/1b thi khong mo san ssh ma chi mo san telnet
nhưng để thực hiện thành công cần lưu ý:
+ Java
cd \
cd C:\Program Files (x86)\Java\jre7\bin
+ Thực hiện acp_commander. Gia thiet IP la 192.168.1.14. Chu y lenh sau tuy chon -c phai nam trong "..." chu khong phai '...'
Kiem tra output co thay 2 file
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /mnt/disk1/share/"
Thuc hien script
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "sh -x /mnt/disk1/share/open-ls.txt"
Vi ly do nao do script khong thuc hien dc => copy sshd_config sang share => chmod 666 de kiem tra, chinh sua ==> copy back to /etc => chmod 600
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /etc/sshd_config /mnt/disk1/share/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 666 /mnt/disk1/share/sshd_config"
Chinh sua PermitRootLogin to "yes" va PermitEmptyPasswords yes
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /mnt/disk1/share/sshd_config"
test OK
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/sshd_config /etc/"
verify ok
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "grep PermitRootLogin /etc/sshd_config"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /etc/sshd_config"
Restart sshd
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "/etc/init.d/sshd.sh restart"
Neu ko dc, thuc hien script thu cong
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /root"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "ls -l /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/authorized_keys /root/.ssh/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "mkdir /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 700 /root/.ssh"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "cp /mnt/disk1/share/authorized_keys /root/.ssh/"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "chmod 600 /root/.ssh/authorized_keys"
java -jar acp_commander.jar -t 192.168.1.14 -ip 192.168.1.14 -pw password -c "dos2unix /root/.ssh/authorized_keys"
Note: doi voi LS-VL neu dung fw 1.65mod1/1a/1b thi khong mo san ssh ma chi mo san telnet
Thứ Bảy, 27 tháng 7, 2013
Increase disk space Ubuntu VM + remove old kernel in /boot
1. Remove all snapshots
2. Increase provisioned size of ubuntu VM
3. Restart VM
4. Folow instructions below. Remember to increase EXT partition first then increase LVM volume later
http://www.joomlaworks.net/blog/item/168-resizing-the-disk-space-on-ubuntu-server-vms
Remove old kernel in /boot
Your boot partition is full. Since this is a kernel update, these files will be copied to the boot partition so you need to clean in out. Here is a blog post that will show you how to clear the old kernel images with one command. I'll give a basic synopsis of the method. Use this command to print out the current version of your kernel:
And that one command will take care of everything for you. I will confirm that this does work perfectly but never trust anybody on the internet. :) For more info, the blog post gives a very good explanation of what each part of the command does so read through it so you are satisfied that it does what you want it to do.
http://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot
2. Increase provisioned size of ubuntu VM
3. Restart VM
4. Folow instructions below. Remember to increase EXT partition first then increase LVM volume later
http://www.joomlaworks.net/blog/item/168-resizing-the-disk-space-on-ubuntu-server-vms
Remove old kernel in /boot
Your boot partition is full. Since this is a kernel update, these files will be copied to the boot partition so you need to clean in out. Here is a blog post that will show you how to clear the old kernel images with one command. I'll give a basic synopsis of the method. Use this command to print out the current version of your kernel:
uname -r
Then use this command to print out all the kernels you have installed that aren't your newest kernel
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9]
Make sure your current kernel isn't on that list. Notice how this is the majority of the final command (down below). To uninstall and delete these old kernels you will want to pipe these arguments to:
sudo apt-get -y purge
Now we can do everything we want by combining these last two commands into this unholy mess:
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge
And that one command will take care of everything for you. I will confirm that this does work perfectly but never trust anybody on the internet. :) For more info, the blog post gives a very good explanation of what each part of the command does so read through it so you are satisfied that it does what you want it to do.
http://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot
Thứ Tư, 8 tháng 5, 2013
Error HTTP 500 access to RoundCube webmail after upgrade ISPConfig to 3.0.5.1
Get error "http 500 internal server error" when trying to access Roundcube webmail after upgrade ISPConfig to 3.0.5.1 (error still remains after upgrade again to 3.0.5.2)
- First check Roundcube error log at /var/log/roundcube
Found errors:
PHP Error: Failed to load plugin file /var/lib/roundcube/plugins/fail2ban/fail2ban.php in /usr/share/roundcube/program/include/rcube_plugin_api.php on line 196 (GET /webmail/)
- Check roundcube config in /var/lib/roundcube/config/main.inc.php for syntax
$rcmail_config['plugins'] = array('fail2ban');
Syntax is correct.
- Check /usr/share/roundcube/plugins/fail2ban/fail2ban.php. Found fail2ban ver 1.0 in directory plugins
- Try to upgrade fail2ban to ver 1.1 following directions below:
--------------------
Install the roundcube logger plugin form http://mattrude.com/projects/roundcube-fail2ban-plugin/.
Basically you have to download the above file (fail2ban.php) and paste it in the fail2ban folder in the plugins folder of roundcube: /usr/share/roundcube/plugins/fail2ban/fail2ban.php
This plugin will first create and then update the log file with each login attempt: /var/log/roundcube/userlogins
cd /usr/share/roundcube/plugins/fail2ban/
wget https://github.com/mattrude/rc-plugin-fail2ban
mv rc-plugin-fail2ban fail2ban.tgz
tar xvfz fail2ban.tgz
Extend the jail.local file that Falko suggests in The Perfect Server - Debian Squeeze (Debian 6.0) With BIND & Courier [ISPConfig 3]: /etc/fail2ban/jail.local
Last (and very important) don't forget to create the roundcube.conf file /etc/fail2ban/filter.d/roundcube.conf with the contents below:
----
[Definition]
failregex = FAILED login for .*. from
ignoreregex =
----
Sources: http://www.howtoforge.com/easy-roundcube-over-ssl-and-webmin-with-fail2ban-for-ispconfig-3-on-debian-squeeze
http://mattrude.com/projects/roundcube-fail2ban-plugin/
Restart fail2ban and apache but problem is not solved. Try to look at apache error log (not roundcube error log)
Found error
---------
SoftException in Application.cpp:221: File "/usr/share/roundcube/index.php" is not in document root of Vhost "/var/www/ispconfig/"
Premature end of script headers: index.php
---------
Anh here is solution for it
http://www.howtoforge.com/forums/showthread.php?t=60746
http://www.howtoforge.com/perfect-server-ubuntu-12.10-apache2-bind-dovecot-ispconfig-3-p4
Thank you HowToForge
- First check Roundcube error log at /var/log/roundcube
Found errors:
PHP Error: Failed to load plugin file /var/lib/roundcube/plugins/fail2ban/fail2ban.php in /usr/share/roundcube/program/include/rcube_plugin_api.php on line 196 (GET /webmail/)
- Check roundcube config in /var/lib/roundcube/config/main.inc.php for syntax
$rcmail_config['plugins'] = array('fail2ban');
Syntax is correct.
- Check /usr/share/roundcube/plugins/fail2ban/fail2ban.php. Found fail2ban ver 1.0 in directory plugins
- Try to upgrade fail2ban to ver 1.1 following directions below:
--------------------
Install the roundcube logger plugin form http://mattrude.com/projects/roundcube-fail2ban-plugin/.
Basically you have to download the above file (fail2ban.php) and paste it in the fail2ban folder in the plugins folder of roundcube: /usr/share/roundcube/plugins/fail2ban/fail2ban.php
This plugin will first create and then update the log file with each login attempt: /var/log/roundcube/userlogins
cd /usr/share/roundcube/plugins/fail2ban/
wget https://github.com/mattrude/rc-plugin-fail2ban
mv rc-plugin-fail2ban fail2ban.tgz
tar xvfz fail2ban.tgz
Extend the jail.local file that Falko suggests in The Perfect Server - Debian Squeeze (Debian 6.0) With BIND & Courier [ISPConfig 3]: /etc/fail2ban/jail.local
Last (and very important) don't forget to create the roundcube.conf file /etc/fail2ban/filter.d/roundcube.conf with the contents below:
----
[Definition]
failregex = FAILED login for .*. from
ignoreregex =
----
Sources: http://www.howtoforge.com/easy-roundcube-over-ssl-and-webmin-with-fail2ban-for-ispconfig-3-on-debian-squeeze
http://mattrude.com/projects/roundcube-fail2ban-plugin/
Restart fail2ban and apache but problem is not solved. Try to look at apache error log (not roundcube error log)
Found error
---------
SoftException in Application.cpp:221: File "/usr/share/roundcube/index.php" is not in document root of Vhost "/var/www/ispconfig/"
Premature end of script headers: index.php
---------
Anh here is solution for it
http://www.howtoforge.com/forums/showthread.php?t=60746
http://www.howtoforge.com/perfect-server-ubuntu-12.10-apache2-bind-dovecot-ispconfig-3-p4
Thank you HowToForge
Thứ Bảy, 8 tháng 9, 2012
Creating a .htaccess file on Windows
Everyone who has tried creating a .htaccess on windows knows that Windows Explorer does not accept the ‘.’ character as the first character of a file. For most of you this may be old stuff, but for the newbies, the quick way to create the file is to open the command prompt and type:
copy con .htaccess [press enter] [press ctrl Z] |
The second way is to:
Open notepad and save the document with file name .htaccess with the ‘save as type’ set to ‘All Files’; or save the document with file name as “.htaccess” including the quotes.
Open notepad and save the document with file name .htaccess with the ‘save as type’ set to ‘All Files’; or save the document with file name as “.htaccess” including the quotes.
Or, you can use “edit” command to create a “.htaccess” file, just open windows command line program, “cmd”, then type “edit .htaccess”, edit the file and save it or if you have already an htaccess file just rename it, “rename htaccess.txt .htaccess”.
Chủ Nhật, 2 tháng 9, 2012
Setup PureFTP over TLS (ISPconfig 3)
+ Add passive port range to router and firewall of ISPconfig. For example: 40110 40210
+ Create new file PassivePortRange and PassivePortRange in /etc/pure-ftpd/conf
+ add parameter in these files
echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange
echo "192.168.xxx..xxx" > /etc/pure-ftpd/conf/ForcePassiveIP
+ restart pureftpd
/etc/init.d/pure-ftpd-mysql restart
+ Wait a minute then Done!
+ check port need to be open in firewall. Run command as root
grep -i ftps /etc/services
You will see the result like below -> so 989:990 need to be open
Explicit: must use TLS
Implicit: use is optional when available
--update----------
In order to force using FTP with TLS in ISPconfig, first refer to pure-ftp's manual
Link http://download.pureftpd.org/pub/pure-ftpd/doc/README.TLS
nano /etc/pure-ftpd/conf/TLS
change value 1 to 2
then restart pure-ftp
/etc/init.d/pure-ftpd-mysql restart
Test FileZilla with plain FTP connection, you'll get error message
"Response: 421 Sorry, cleartext sessions are not accepted on this server."
+ Create new file PassivePortRange and PassivePortRange in /etc/pure-ftpd/conf
+ add parameter in these files
echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange
echo "192.168.xxx..xxx" > /etc/pure-ftpd/conf/ForcePassiveIP
+ restart pureftpd
/etc/init.d/pure-ftpd-mysql restart
+ Wait a minute then Done!
+ check port need to be open in firewall. Run command as root
grep -i ftps /etc/services
You will see the result like below -> so 989:990 need to be open
ftps-data 989/tcp # FTP over SSL (data) ftps 990/tcpSpecify Encryption type in FileZilla is:Require explicit FTP over TLS (see pic below)
Implicit: use is optional when available
--update----------
In order to force using FTP with TLS in ISPconfig, first refer to pure-ftp's manual
Link http://download.pureftpd.org/pub/pure-ftpd/doc/README.TLS
------------------------ ACCEPTING TLS SESSIONS ------------------------
Once the certificate has been installed, you need to start a TLS-enabled
pure-ftpd daemon with the -Y (or --tls=) switch. Example :
/usr/local/sbin/pure-ftpd --tls=1 &
- With "--tls=0", support for SSL/TLS is disabled. This is the default.
- With "--tls=1", clients can connect either the traditional way or through an
SSL/TLS layer. This is probably the setting you need if you want to enable
TLS without having too much angry customers.
- With "--tls=2", cleartext sessions are refused and only SSL/TLS compatible
clients are accepted.
- With "--tls=3", cleartext sessions are refused and only SSL/TLS compatible
clients are accepted. Clear data connections are also refused, so private
data connections are enforced. This is an extreme setting.
When SSL/TLS has been successfully negociated for a connection, you'll see
something similar to this in log files :
<<
SSL/TLS: Enabled TLSv1/SSLv3 with AES256-SHA, 256 secret bits cipher
>>
A cipher using traditional algorithms with a 40 bits key is weak but
exportable to almost any country. This is the minimum size accepted by the
server, else a "Cipher too weak" error message will be logged and reported to
the client.
--------------------nano /etc/pure-ftpd/conf/TLS
change value 1 to 2
then restart pure-ftp
/etc/init.d/pure-ftpd-mysql restart
Test FileZilla with plain FTP connection, you'll get error message
"Response: 421 Sorry, cleartext sessions are not accepted on this server."
Thứ Sáu, 16 tháng 3, 2012
Summary of Ubuntu Linux
FTP Server Installation
sudo apt-get install vsftpd
Anonymous FTP Configuration
By default vsftpd is not configured to only allow anonymous download. If you wish to enable anonymous download edit/etc/vsftpd.conf changing: anonymous_enable=Yes During installation a ftp user is created with a home directory of
/srv/ftp. This is the default FTP directory. If you wish to change this location, to
/srv/files/ftp for example, simply create a directory in another location and change the ftp user's home directory: sudo mkdir /srv/files/ftp sudo usermod -d /srv/files/ftp ftp
User Authenticated FTP Configuration
By default vsftpd is configured to authenticate system users and allow them to download files. If you want users to be able to upload files, edit/etc/vsftpd.conf: write_enable=YES
Now restart vsftpd:sudo restart vsftpd
Nguồn: https://help.ubuntu.com/10.10/serverguide/C/ftp-server.html
-------------------------------
Install desktop Environment
First you nee to make sure you have enabled Universe and multiverse repositories in /etc/apt/sources.list file once you have enable you need to use the following command to install GUI
sudo apt-get update
sudo apt-get install ubuntu-desktopThe above command will install GNOME desktop
If you wan to install a graphical desktop manager without some of the desktop addons like Evolution and OpenOffice, but continue to use the server flavor kernel use the following command
sudo aptitude install --without-recommends ubuntu-desktopIf you want to install light weight desktop install xfce using the following command
sudo apt-get install xubuntu-desktopIf you want to install KDE desktop use the following command
sudo apt-get install kubuntu-desktop
Chu y: sau khi test chi co ubuntu-desktop (ban full) va kubuntu la chay dc
Link: http://www.ubuntugeek.com/install-gui-in-ubuntu-server.html
--------------------------
Configuring Static ip address in Ubuntu server
If you want to install vim editor use the following command
sudo apt-get install vim-full
Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit
Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):
sudo vi /etc/network/interfaces
nếu dùng kubuntu
sudo kate /etc/network/interfaces and enter the following save the file and exit (In vi, ESC, then ZZ to save and exit) # The primary network interface auto eth0 iface eth0 inet static address 172.19.0.10 netmask 255.255.255.0 #network 172.19.0.0 #broadcast 172.19.0.255 gateway 172.19.0.1 Now you need to restart your network services using the following command sudo /etc/init.d/networking restart You need to setup manually DNS servers in resolv.conf file when you are not using DHCP. sudo vi /etc/resolv.conf You need to add look something like this search domain.com nameserver xxx.xxx.xxx.xxx
Lệnh kiểm tra ifconfig
Thay đổi host, workgroup
sudo gedit /etc/hostnameSửa hosts filesudo gedit /etc/hostsChange your system workgroup name, run the command below to edit samba smb.conf file.sudo gedit /etc/samba/smb.confLưu ý: thay gedit bằng hoặc vi, kate... nếu không dùng ubuntu desktop
------------------ Install VMware Tools for Ubuntu Link: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1022525 Ubuntu Server with only a Command Line Interface Go to Virtual Machine > Install VMware Tools (or VM > Install VMware Tools). Note: If you are running the light vesion of Fusion, or a version of Workstation without VMware Tools, or VMware Player, you are prompted to download the Tools before they can be installed. Click Download Now to begin the download. In the Ubuntu guest, run these commands: sudo mkdir /mnt/cdrom When prompted for a password, enter your Ubuntu admin user password. Note: For security reasons, the typed password is not displayed. You do not need to enter your password again for the next five minutes. sudo mount /dev/cdrom /mnt/cdrom The file name of the VMware Tools bundle varies depending on your version of the VMware product. Run this command to find the exact name: ls /mnt/cdrom tar xzvf /mnt/cdrom/VMwareTools-.tar.gz -C /tmp/ Note: Reset MySQL root passwordis the version discovered in the previous step. cd /tmp/vmware-tools-distrib/ sudo ./vmware-install.pl -d Note: The -d switch assumes that you want to accept the defaults. If you do not use -d, press Return to accept each default or supply your own answers. Run this command to reboot the virtual machine after the installation completes: sudo reboot ------------
In this tip we will see how to change or reset the MySQL root password under Ubuntu. This tip is tested under Ubuntu 11.10 and may work for other older versions of Ubuntu (11.04/10.10/10.04 or older). This tutorial is also useful for users that forget to assign a MySQL root password during the installation of the MySQL client. If no password assigned, you may get this error when trying to login to the MySQL server: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Getting Started 1. Open the terminal (Ctrl+Alt+T) and stop the MySQL server with this command: sudo /etc/init.d/mysql stop 2. Run now this command to start the MySQL configuration: sudo mysqld --skip-grant-tables & 3. Login now to the MySQL server as root: mysql -u root mysql 4. Change now your MySQL root password with this command: UPDATE user SET Password=PASSWORD('NEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit; Replace NEWPASSWORD with any password of your choice. You can now login smoothly to the MySQL server with the assigned password.
Link: https://help.ubuntu.com/community/MysqlPasswordReset
-------------------------------
Nếu đang dùng ubuntu desktop -> Ctrl – Alt – T to open Terminal.
Hướng dẫn sử dụn vi tại đây http://www.cs.colostate.edu/helpdocs/vi.html
Thứ Tư, 11 tháng 5, 2011
Enable SSH for root + patch ESX Server 3i
ESXi 3.5 does ship with the ability to run SSH, but this is disabled by default (and is not supported). If you just need to access the console of ESXi, then you only need to perform steps 1 - 3.
1) At the console of the ESXi host, press ALT-F1 to access the console window.
2) Enter unsupported in the console and then press Enter. You will not see the text you type in.
3) If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4) You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5) Find the line that begins with #ssh and remove the #. Then save the file. If you're new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file.
6) Once you've closed the vi editor, run the command /sbin/services.sh restart to restart the management services. You'll now be able to connect to the ESXi host with a SSH client.
2) Enter unsupported in the console and then press Enter. You will not see the text you type in.
3) If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4) You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5) Find the line that begins with #ssh and remove the #. Then save the file. If you're new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file.
6) Once you've closed the vi editor, run the command /sbin/services.sh restart to restart the management services. You'll now be able to connect to the ESXi host with a SSH client.
Tip - with some applications like WinSCP, the default encryption cipher used is AES. If you change that to Blowfish you will likely see significantly faster transfers.
Update for ESXi 3.5 Update 2 - With Update 2 the service.sh command no longer restarts the inetd process which enables SSH access. You can either restart your host or run ps | grep inetd to determine the process ID for the inetd process. The output of the command will be something like 1299 1299 busybox inetd, and the process ID is 1299. Then run kill -HUP (kill -HUP 1299 in this example) and you'll then be able to access the host via SSH.
You can also download an oem.tgz file which will enable SSH (and FTP). Copy the file to a datastore with the VI client and then to bootbank with the command cp /vmfs/volumes//oem.tgz /bootbank/oem.tgz and then reboot.
Đăng ký:
Bài đăng (Atom)
