728x90 AdSpace

  • Latest News

    Được tạo bởi Blogger.
    Thứ Tư, 6 tháng 3, 2019

    Bài 10: Hướng dẫn xem lịch sử lệnh (history command) trên ESXi Shell

    nino24 ) - Có một số bạn thắc mắc là khi sử dụng ESXi Shell thì liệu có chương trình lệnh “history” để xem lại lịch sử lệnh đã gõ trên ESXi shell không ? Thì mình cũng xin trình bày là trên ESXi shell hiện không hỗ trợ lệnh nào giống ‘history‘ của Linux cả .

    Vậy làm thế nào để có thể xem thông tin lịch sử lệnh đã gõ trên ESXi Shell đây ? Đối với VMWarevSphere ESXi phiên bản 5.x trở lên thì VMWare đã thực hiện lưu các câu lệnh đã đánh trên ESXi shell tại file ‘/var/log/shell.log‘. File ‘shell.log‘ này sẽ lưu toàn bộ lệnh đã được gõ bởi toàn bộ user trên ESXi. Cực kì tiện lợi phải không nào.


    # ssh root@192.168.100.100
    Password:
    The time and date of this login have been sent to the system logs.

    VMware offers supported, powerful system administration tools. Please
    see www.vmware.com/go/sysadmintools for details.

    The ESXi Shell can be disabled by an administrative user. See the
    vSphere Security documentation for more information.

    # cat /var/log/shell.log
    2017-11-26T13:15:40Z shell[328760]: Interactive shell session started
    2017-11-26T13:18:20Z shell[328760]: [root]: vim-cmd /hostsvc/hostsummary | grep inMaintenanceMode
    2017-11-26T13:19:00Z shell[328760]: [root]: vimsh -n -e /hostsvc/hostsummary | grep inMaintenanceMode
    2017-11-26T13:22:41Z shell[328760]: [root]: vim-cmd vmsvc/getallvms
    2017-11-28T05:50:21Z shell[447298]: Interactive shell session started
    2017-11-28T05:50:23Z shell[447298]: [root]: cd /vmfs
    2017-11-28T05:50:24Z shell[447298]: [root]: ll
    2017-11-28T05:50:24Z shell[447298]: [root]: ls
    2017-11-28T05:50:26Z shell[447298]: [root]: cd volumes/
    2017-11-28T05:50:26Z shell[447298]: [root]: ls
    2017-11-28T05:50:28Z shell[447298]: [root]: cd datastore1/
    2017-11-28T05:50:29Z shell[447298]: [root]: ls
    2017-11-28T05:50:32Z shell[447298]: [root]: cd ISO/
    2017-11-28T05:50:32Z shell[447298]: [root]: ls
    2017-11-28T05:50:58Z shell[447298]: [root]: pwd


    Như vậy bạn đã biết cách xem lại lịch sử lệnh (history command) trên ESXi Shell rồi phải không nào ?!




    Người viết :
    Biên soạn lại : longhuong



    Nhập địa chỉ email vào form bên dưới để nhận được tin từ đề tài này sớm nhất
    ( Vui lòng kích hoạt email khi nhận được link kích hoạt nhé )



    Nếu thấy hay thì click vào nút follow (G+) bên dưới nhé ! Thanks !

    Nếu thấy hay thì click vào nút thích (Like) bên dưới nhé ! Thanks !
    • Nino24 Comments
    • Facebook Comments
    Item Reviewed: Bài 10: Hướng dẫn xem lịch sử lệnh (history command) trên ESXi Shell Rating: 5 Reviewed By: Poster
    Scroll to Top