Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Sunday, March 2, 2014

Installing and Configuring SSH on CentOS
















1. Open 'terminal', run '/sbin/service sshd status' to check ssh status
2. user 'sudo' to run 'yum install openssh-server' to install if needed (#su).
3. '/sbin/service sshd start' (start/stop/restart) to start,stop and restart the service 
4. 'vi /etc/sysconfig/iptables' to config system firewall
5. Hit 'i' to midify mode
6. add '-A INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT' (after dport 22 line)
7. Hit 'ESC' key and ':wq!' to quit vi.
8. 'vi /etc/ssh/sshd_config' to config SSH protocol
9. modify the protocol 2 (more security than protocol 1)
10. at the bottom of the file add
#Prevent root logins:
PermitRootLogin no
AllowUsers xxxx(username)
11.":wq!" to quit vi
12. '/sbin/service sshd restart' and '/sbin/service iptables restart' to restart SSH and iptables
13. connect SSH server --> sudo/sbin/service sshd restart to check

Saturday, March 1, 2014

Linux Centos 6 - Sudoers - Add User with Sudo Privileges


1. sodusgroup group to linux system
2. add user and move it to sodusgroup group
3. open 'teminal' and run 'visudo' command
4. find 'root ALL...'
5. Hit 'i' to insert a line after 'root' line
6. as "%sudosgroup ALL=(ALL) ALL"
7. 'ESC' and ':x' to save and exit visudo command
8. logout an root user and login as the new use
9. new command 'sudo yum update' to check user set up corrrectly