ubuntu下允许root用户ssh远程登录及Linux下服务的启动
2016-06-13 10:09
986 查看
参考:
1. http://blog.sina.com.cn/s/blog_7e64a87b0100rn8w.html
2. http://www.111cn.net/sys/Ubuntu/61252.htm (Ubuntu 14.04)
启用root用户:
安装OpenSSH server:
1. 使用apt命令安装openssh server
2. 可以对 openssh server进行配置
找到PermitRootLogin no一行,改为PermitRootLogin yes
3. 重启 openssh server
4. 客户端如果是ubuntu的话,则已经安装好ssh client,可以用下面的命令连接远程服务器。
如果是windows系统的话,可以使用SSH Secure Shell等ssh软件进行远程连接。
将
修改好后别忘了重启sshd服务
之后,root用户即可直接SSH远程管理服务器了。从这里可以看出ubuntu server 14.04在安全方面还是有所提升的哈。
下面以apache为例:
基本的操作方法:
本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况
apahce启动命令:
推荐
apache停止命令
apache重新启动命令:
要在重启 Apache 服务器时不中断当前的连接,则应运行:
如果apache安装成为linux的服务的话,可以用以下命令操作:
Linux系统为Ubuntu
一、Start Apache 2 Server /启动apache服务
or
$ sudo /etc/init.d/apache2 start
二、 Restart Apache 2 Server /重启apache服务
or
三、Stop Apache 2 Server /停止apache服务
or
1. http://blog.sina.com.cn/s/blog_7e64a87b0100rn8w.html
2. http://www.111cn.net/sys/Ubuntu/61252.htm (Ubuntu 14.04)
Ubuntu Server 12.04
SSH服务器,可以通过SSH协议来访问远程服务器,代替telnet和ftp。但是ubuntu默认是不启用root用户也不允许root远程登录的。所以需要先启用root用户启用root用户:
sudo passwd root//修改密码后就启用了。
安装OpenSSH server:
1. 使用apt命令安装openssh server
$ sudo apt-get install openssh-server
2. 可以对 openssh server进行配置
$ sudo vi /etc/ssh/sshd_config
找到PermitRootLogin no一行,改为PermitRootLogin yes
3. 重启 openssh server
$ sudo service ssh restart
4. 客户端如果是ubuntu的话,则已经安装好ssh client,可以用下面的命令连接远程服务器。
$ ssh xxx.xxx.xxx.xxx
如果是windows系统的话,可以使用SSH Secure Shell等ssh软件进行远程连接。
Ubuntu Server 14.04
Ubuntu Server 14.04 开启Root用户SSH权限:sudo vi /etc/ssh/sshd_config
将
PermitRootLogin without-password的
without-assword修改为
yes即可。
修改好后别忘了重启sshd服务
sudo /etc/init.d/ssh restart又或者是
sudo service ssh restart
之后,root用户即可直接SSH远程管理服务器了。从这里可以看出ubuntu server 14.04在安全方面还是有所提升的哈。
Linux下服务的启动
出处: http://blog.sina.com.cn/s/blog_70ac6bec01018mqs.html下面以apache为例:
基本的操作方法:
本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况
apahce启动命令:
推荐
/usr/local/apache2/bin/apachectl start apaceh启动
apache停止命令
/usr/local/apache2/bin/apachectl stop停止
apache重新启动命令:
/usr/local/apache2/bin/apachectl restart重启
要在重启 Apache 服务器时不中断当前的连接,则应运行:
/usr/local/sbin/apachectl graceful
如果apache安装成为linux的服务的话,可以用以下命令操作:
service httpd start启动
service httpd restart重新启动
service httpd stop停止服务
Linux系统为Ubuntu
一、Start Apache 2 Server /启动apache服务
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
二、 Restart Apache 2 Server /重启apache服务
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
三、Stop Apache 2 Server /停止apache服务
# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- Linux socket 初步
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- ubuntu下chrome无法同步问题解决
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验