我在 ubuntu 10 用户名上创建了一个新用户:codeuser
有一个名为“admin”的现有用户。现在,我的问题是我无法使用 codeuser 凭据直接连接到服务器。但是,我可以通过“admin”然后 su(将用户更改为 codeuser)SSH 进入,并且它可以工作。如何让 shell 访问 codeuser 用户?
这是我的文件的输出:
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
www-data:x:33:33:www-data:/var/www:/bin/bash
admin:x:1000:1000:,,,:/home/admin:/bin/bash
ftp:x:107:65534::/home/ftp:/bin/false
codeuser:x:1004:33::/home/codeuser:/bin/bash
cat /etc/group
root:x:0:
www-data:x:33:
codeuser:x:1005:
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Run Code Online (Sandbox Code Playgroud) 我似乎找不到停止/重新启动 proftpd 的方法。我的服务器 IP 地址是 xx.yy.zz.ww 并且通过 FTP 从外部设备连接给我提示:
Connected to xx.yy.zz.ww
220 ProFTPD 1.3.1 Server (ProFTPD)
Run Code Online (Sandbox Code Playgroud)
然后它问我用户名。
当我尝试从同一台服务器(ftp localhost)连接时,会发生同样的事情。因此,我确定 proftp 正在我的服务器上运行。
另外,在我的服务器 (xx.yy.zz.ww) 上。我在拖尾/var/log/messages
,它显示我打开和关闭了 FTP 会话。
我找不到 proftpd 是如何工作的。/etc/init.d/ 没有 proftpd ;/etc/xinetd.d/ 没有 proftpd。
我看了看:/etc/proftpd.conf
它显示了我ServerType inetd
另外,当我运行时:ps -auxfww
| grep proftp 我什么也没得到(除了我当前的命令)
我怎样才能知道 proftp 正在运行,我怎样才能杀死它/重新启动它?
我有一个 cron 设置为每分钟运行一次
* * * * * /usr/php /my/location/script.php
Run Code Online (Sandbox Code Playgroud)
现在,我使用time函数来测量脚本执行时间。所以,运行
console$ time /usr/php /my/location/script.php
Run Code Online (Sandbox Code Playgroud)
产出
real 0m0.000s
user 0m0.000s
sys 0m0.000s
Run Code Online (Sandbox Code Playgroud)
但它不适用于这样的 cron:
* * * * * time /usr/php /my/location/script.php 2>&1 >> my_log_file
Run Code Online (Sandbox Code Playgroud)
它也不适用于命令行
console$ time /usr/php /my/location/script.php >> my_log_file
Run Code Online (Sandbox Code Playgroud)
在以上两个示例中,time 函数实际上计算写入 my_log_file 所花费的时间,而不是将其输出写入日志文件。在脚本中添加代码并记录 STD 输出不是一个选项。
我们有一种情况,我们将在世界和我们的应用服务器池之间引入负载均衡器。我们域的 DNS 应该指向负载均衡器,并在内部重定向流量。问题是 DNS 传播需要时间,而且我们不能有任何停机时间。
现在的情况
x.y.z.123 is the APP server
DNS www.mysite.com points to x.y.z.123
Run Code Online (Sandbox Code Playgroud)
预期新情况
x.y.z.250 is the load balancer
x.y.z.123 is the APP server
DNS www.mysite.com points to x.y.z.250
Run Code Online (Sandbox Code Playgroud)
哪种方法最好?我对具有中间步骤的解决方案没意见。更改 APP 服务器的 IP 地址不是解决方案。